Nb 8.2RC DropDownButtonFactory behavior changed ? Problem solved as well.
"bruehlicke" <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <[email protected]> |
I have been using the DropDownButtonFactory as described in https://blogs.oracle.com/geertjan/entry/org_openide_awt_dropdownbuttonfactory1 and combined with ContextAware like http://wiki.netbeans.org/DevFaqDropdownMenuAddToolbarEnabled
Working fine in 6.x but in 8.2 RC I just get a grey 32x32 box at the location of the dropdownbutton in the initial start of the application. First after an object is selected and the action is enabled the icon for the dropdownbox is rendered. If out of context again - it becomes the 32x32 grey box again.
The code used:
dropDownButton = DropDownButtonFactory.createDropDownButton(
new ImageIcon(
new BufferedImage(32, 32, BufferedImage.TYPE_BYTE_GRAY)),
popup);
dropDownButton.setIcon(icon);
Fix for 8.2RC:
dropDownButton = DropDownButtonFactory.createDropDownButton(
icon,
popup);
i.e. do not call the .setIcon() method on the JButton.
Again, just a low hanging fruit, but could be interesting if others have similar experience and why the dropDownButton.setIcon(icon) somehow is not working for showing the initial disabled state of the button.