christmo / macwidgets

Automatically exported from code.google.com/p/macwidgets
0 stars 0 forks source link

HUDComboBoxUI shows wrong selection after setting selected index #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have a JComboBox with the HUD UI set. I have added an ActionListener to
the combobox like so:

public void actionPerformed(ActionEvent e) {
   if (combo.getSelectedIndex() == 5) {
      combo.setSelectedIndex(2);
      combo.repaint();
   }
}

The call to "setSelectedIndex" is not reflected in the UI. I can see that
the correct index (2) is set when I pop up the selection list, but the
rendered text is still the one of index 5.

Original issue reported on code.google.com by t.s.mae...@gmail.com on 20 Mar 2009 at 9:50

GoogleCodeExporter commented 8 years ago
I'm guessing that I'm not listening to a client property that indicates that 
the selected item has changed. This 
should be easy to fix.

Original comment by kenneth....@gmail.com on 20 Mar 2009 at 11:10

GoogleCodeExporter commented 8 years ago
This strangely did not happen on my Mac, but I've added an action listener that 
updates the displayed text 
anyway. Please let me know if the attached jar file fixes the issue (note that 
in the attached jar are the latest 
changes in Mac Widgets for Java which my conflict with your version).

Original comment by kenneth....@gmail.com on 30 Mar 2009 at 11:43

Attachments:

GoogleCodeExporter commented 8 years ago
Works for me with the attached jar.

Original comment by t.s.mae...@gmail.com on 2 Apr 2009 at 8:17