addMouseMotionListener(new MouseAdapter() {
public void mouseMoved(MouseEvent e) {
try{
nowIndex = -1;
for (int i = 0; i < getTabCount(); i++) {
if (closeRects[i].contains(e.getPoint())
&& closable.get(i)) {
nowIndex = i;
break;
}
}
在有时情况下closeRects[i]对象只有一个,getTabCount()为2。此时会数组越界。帮忙看下能弄好不?谢谢
public void mouseMoved(MouseEvent e) {
try{
nowIndex = -1;
for (int i = 0; i < getTabCount(); i++) {
if (closeRects[i].contains(e.getPoint())
&& closable.get(i)) {
nowIndex = i;
break;
}
}
在有时情况下closeRects[i]对象只有一个,getTabCount()为2。此时会数组越界。帮忙看下能弄好不?谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货