void (MouseEvent e) { Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (myIsEngaged && !UIUtil.isSelectionButtonDown(e) && !(focusOwner instanceof JRootPane)) { Point point = e.getPoint(); int index = list.locationToIndex(point); list.putClientProperty(SELECTED_BY_MOUSE_EVENT, Boolean.TRUE); list.setSelectedIndex(index); list.putClientProperty(SELECTED_BY_MOUSE_EVENT, Boolean.FALSE); } else { myIsEngaged = true; } }