-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0, 1.4.2
-
None
-
beta
-
generic, x86
-
generic, solaris_8, windows_xp
We can create JMenuItem from an action. When you do that, the JMenuitem calls 'setAction()' which is in its superclass AbstractButton.'setAction()' in AbstractButton calls configurePropertiesFromAction() which sets all the properties including tooltip text from Action.SHORT_DESCRIPTION.
Also, at this time, JMenuItem adds itself as a propertyChange listener
to listen for property change events.
After this whenever we update the 'SHORT_DESCRIPTION' of the Action
instance, the JMenuItem instance does not reflect the change in its
tooltip. This is because, its propertyChange() method does not listen
for changes to 'SHORT_DESCRIPTION'. This is the shortcoming I am
referring to. During construction, JMenuItem sets everything by passing
it to its superclass, but when there is change on some of the
properties, JMenuItem does not reflect the change because its change
listener is not listening for them ( in particular changes to
SHORT_DESCRIPTION ).
Also, at this time, JMenuItem adds itself as a propertyChange listener
to listen for property change events.
After this whenever we update the 'SHORT_DESCRIPTION' of the Action
instance, the JMenuItem instance does not reflect the change in its
tooltip. This is because, its propertyChange() method does not listen
for changes to 'SHORT_DESCRIPTION'. This is the shortcoming I am
referring to. During construction, JMenuItem sets everything by passing
it to its superclass, but when there is change on some of the
properties, JMenuItem does not reflect the change because its change
listener is not listening for them ( in particular changes to
SHORT_DESCRIPTION ).
- duplicates
-
JDK-6239032 JMenuItems configured with action don't respond to change in accelerator
-
- Closed
-
-
JDK-6182654 JMenuItem has to update its short description on Action's setValue(SHORTDSC)
-
- Closed
-