sjPlot / macwidgets

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

HudComboboxUI does not paint correctly with empty DefaultComboBoxModel #122

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. HudWidgetFactory.createHudComboBox(new DefaultComboBoxModel())

or removing all elements in the model,  
defaultComboboxModel.removeAllElements() 

What is the expected output? What do you see instead?
A JComboBox with no items, instead I see a collapsed box with almost no height.
Clicking the component results in a ArrayIndexOutOfBoundsException.

What version of the product are you using? On what operating system?
macwidgets 0.9.5 - OSX 10.5.8

Please provide any additional information below.

This code produces the problem:

...
content.add(HudWidgetFactory.createHudComboBox(new DefaultComboBoxModel()));
content.add(HudWidgetFactory.createHudComboBox(new 
DefaultComboBoxModel(items)));
...

see attached image.

Original issue reported on code.google.com by frode...@gmail.com on 24 Aug 2009 at 1:56

Attachments:

GoogleCodeExporter commented 8 years ago
Changed display value from "" to " " when there is no selected item. Also added 
check for existence of items 
before trying to show popup. You'll find the latest Mac Widgets for Java build 
here:

http://www.macwidgetsforjava.com/downloads/latest/mac_widgets.jar

Original comment by kenneth....@gmail.com on 24 Aug 2009 at 11:17

GoogleCodeExporter commented 8 years ago
Did the trick.

However, adding new Objects to the model will not be drawn correctly in the 
drop-down list.
The drop-down list does not update its height, resulting in the items getting 
smaller (height).

...
content.add(HudWidgetFactory.createHudComboBox(model);
...

@Action void add() {
   model.addElement("new element");
}
...

see attached image.

Original comment by frode...@gmail.com on 24 Aug 2009 at 1:52

Attachments:

GoogleCodeExporter commented 8 years ago
Give it another try -- should be fixed now.

Original comment by kenneth....@gmail.com on 24 Aug 2009 at 7:04

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I found another issue.

Adding a new object to a empty DefaultComboboxModel without selecting the newly 
added object will result in a ArrayIndexOutOfBoundsException when clicking the 
JCombobox instance.

I attached code that shows how the error occurs. 

Original comment by frode...@gmail.com on 24 Aug 2009 at 10:19

Attachments:

GoogleCodeExporter commented 8 years ago
OK, should be fixed.

Original comment by kenneth....@gmail.com on 24 Aug 2009 at 11:02

GoogleCodeExporter commented 8 years ago
Yes, it is fixed now!

Original comment by frode...@gmail.com on 24 Aug 2009 at 11:28