protected void showPopup (MouseEvent e) { Point p = new Point (e.getX (), e.getY ()); int i = list.locationToIndex (p); if (!list.isSelectedIndex (i)) { list.setSelectedIndex (i); } // the area of selected Rectangle r = list.getCellBounds(i, i); boolean contextMenu = (r == null) || !r.contains (p); createPopup(e.getX(), e.getY(), contextMenu); }
protected void showPopup (MouseEvent e) { Point p = new Point (e.getX (), e.getY ()); int i = list.locationToIndex (p); if (!list.isSelectedIndex (i)) { list.setSelectedIndex (i); } // the area of selected Rectangle r = list.getCellBounds(i, i); boolean contextMenu = (r == null) || !r.contains (p); createPopup(e.getX(), e.getY(), contextMenu); }
protected void showPopup(MouseEvent e) { Point p = new Point(e.getX(), e.getY()); int i = list.locationToIndex(p); if (!list.isSelectedIndex(i)) { list.setSelectedIndex(i); } // the area of selected Rectangle r = list.getCellBounds(i, i); boolean contextMenu = (r == null) || !r.contains(p); createPopup(e.getX(), e.getY(), contextMenu); }
public void run() { boolean multisel = (list.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION); int i = (multisel ? list.getLeadSelectionIndex() : list.getSelectedIndex()); if (i < 0) { return; } Point p = list.indexToLocation(i); if (p == null) { return; } createPopup(p.x, p.y, false); }
public void run() { boolean multisel = (list.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION); int i = (multisel ? list.getLeadSelectionIndex() : list.getSelectedIndex()); if (i < 0) return; Point p = list.indexToLocation(i); if (p == null) return; createPopup(p.x, p.y, false); }
public void run() { boolean multisel = (list.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION); int i = (multisel ? list.getLeadSelectionIndex() : list.getSelectedIndex()); if (i < 0) return; Point p = list.indexToLocation(i); if (p == null) return; createPopup(p.x, p.y, false); }