< prev index next >
src/java.desktop/share/classes/sun/swing/FilePane.java
Print this page
*** 42,51 ****
--- 42,53 ----
import javax.swing.filechooser.*;
import javax.swing.plaf.basic.*;
import javax.swing.table.*;
import javax.swing.text.*;
+ import sun.awt.AWTAccessor;
+ import sun.awt.AWTAccessor.MouseEventAccessor;
import sun.awt.shell.*;
/**
* <b>WARNING:</b> This class is an implementation detail and is only
* public so that it can be used by two packages. You should NOT consider
*** 1856,1872 ****
listSelectionModel.isSelectedIndex(index)) {
// Make a new event with the list as source, placing the
// click in the corresponding list cell.
Rectangle r = list.getCellBounds(index, index);
! evt = new MouseEvent(list, evt.getID(),
evt.getWhen(), evt.getModifiers(),
r.x + 1, r.y + r.height/2,
evt.getXOnScreen(),
evt.getYOnScreen(),
evt.getClickCount(), evt.isPopupTrigger(),
evt.getButton());
}
} else {
return;
}
--- 1858,1878 ----
listSelectionModel.isSelectedIndex(index)) {
// Make a new event with the list as source, placing the
// click in the corresponding list cell.
Rectangle r = list.getCellBounds(index, index);
! MouseEvent newEvent = new MouseEvent(list, evt.getID(),
evt.getWhen(), evt.getModifiers(),
r.x + 1, r.y + r.height/2,
evt.getXOnScreen(),
evt.getYOnScreen(),
evt.getClickCount(), evt.isPopupTrigger(),
evt.getButton());
+ MouseEventAccessor meAccessor = AWTAccessor.getMouseEventAccessor();
+ meAccessor.setCausedByTouchEvent(newEvent,
+ meAccessor.isCausedByTouchEvent(evt));
+ evt = newEvent;
}
} else {
return;
}
< prev index next >