-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
x86
-
windows_nt
Name: rk38400 Date: 05/13/98
Action processing in Swing is only half done:
1. Only JButtons may be added to a JToolbar.
Can't associate a JToggleButton or other types.
2. Only JMenuItems may be added to JMenu
Can't associate a JCheckBoxMenuItem or JRadioaButtonMenuItem
3. The current method of using an Action to create the component
limits the type of components that can be associated with the Action.
4. The same code is replicated in several places (re property change)
Suggestions:
1. Generalize (Move) action handling to AbstarctButton (or possibly JComponent).
2. Add a checked property to Action to enable control of JToggleButton,JCheckBoxMenuItem
etc. (or add CheckedAction as a subclass of Action).
3. Allow asociation of an Action with an existing button/component: AbstractButton.setAction().
This would setup the appropriate property change listeners etc (as now with JToolBar.add(Action))).
Actions are a nice idea but are not fully implemented. I'm sure these particular suggestions are flawed,
but they indicate the need for a more general solution.
(Review ID: 30286)
======================================================================
- duplicates
-
JDK-4129785 Request for enhanced Action Interface
-
- Closed
-