Re: AbstractAction
- From: Thomas Fritsch <i.dont.like.spam@xxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 12:05:57 GMT
toton wrote:
From Java 1.5 or lower version, can an Action be used for JCheckBox &JCheckBox, JCheckBoxMenuItem, JToggleButton and JCheckBoxMenuItem all have a constructor taking an Action. They also have a setAction(Action) method inherited from AbstractButton.
JCheckBoxMenuItem pair or JToggleButton & JCheckBoxMenuItem pair?
Java 1.6 has Action.SELECTED_KEY but 1.5 doesnt have.So what?
Also how to execute an Action from program? like JButton has aYou can do
doClick method. I want to execute an action from program even when the
actual button or menuitem is removed from gui, thus i dont have an
reference for the actual gui component.
Action a = ...;
ActionEvent e =
new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "bla";
a.actionPerformed(e);
--
Thomas
.
- Follow-Ups:
- Re: AbstractAction
- From: toton
- Re: AbstractAction
- References:
- AbstractAction
- From: toton
- AbstractAction
- Prev by Date: Re: Button event
- Next by Date: Re: GridBagBlues #2376234
- Previous by thread: AbstractAction
- Next by thread: Re: AbstractAction
- Index(es):