int index = list.locationToIndex(anEvent.getPoint());  if (index >= 0)
Point point = anEvent.getPoint(); if (list != null) { int index = list.locationToIndex(point); if (index == -1) { if (point.y < 0) index = 0; else index = comboBox.getModel().getSize() - 1; } if (list.getSelectedIndex() != index) {
  protected void updateListBoxSelectionForEvent(MouseEvent anEvent,                                                boolean shouldScroll)  {    // TODO: We need to handle the shouldScroll parameter somehow.    int index = list.locationToIndex(anEvent.getPoint());    // Check for valid index.    if (index >= 0)      list.setSelectedIndex(index);  }