int index = list.locationToIndex(anEvent.getPoint());  if (index >= 0) comboBox.setSelectedIndex(index);
comboBox.setSelectedIndex(list.getSelectedIndex());
    public void mouseReleased(MouseEvent anEvent)    {      int index = list.locationToIndex(anEvent.getPoint());      // Check for valid index.      if (index >= 0)      comboBox.setSelectedIndex(index);      hide();    }