Swing actions regression?
I have a Swing application that targets Java 5, and as such can't take advantage of improvements to javax.swing.Action in Mustang. Specifically, the same action requires a different (16x16) icon in the menu bar compared with the toolbar (24x24). Although Mustang adds the LARGE_ICON property to support this, I can't use this in Java 5. I worked around this for Java 5 by creating a "wrapper" action with the bigger icon for the toolbar, wrapping the "real" action added to the menu bar: the workaround makes the wrapper action a PropertyChangeListener for the real action.
However, this stopped working in Mustang (I've been using very recent builds). In Java 5, when the property "enabled" is changed (this is frequent occurrence in my application, based on context), the toolbar icons are enabled/disabled (drawn ghosted) in the toolbar as expected. In Mustang, it doesn't happen.
I looked at this, and it seemed that with both Java 5 and Java 6, calling "Action.setEnabled(true|false)" always correctly fires the property change event, but in Java 6, for the toolbar at least, when I propagate the property change for "enabled", nothing happens.
This is the workaround my "ActionToolBarWrapper" uses:
public void propertyChange(final PropertyChangeEvent evt)
...whereas in Java 5, only the last line in the method body was required.
Is this a bug or an implementation detail that's affecting me?