< prev index next >

src/share/classes/sun/swing/FilePane.java

Print this page

        

@@ -42,10 +42,12 @@
 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

@@ -1833,17 +1835,21 @@
                     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(),
+                    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 >