actionPerformed programmatically  
Author Message
Greg





PostPosted: 2003-10-29 18:05:00 Top

java-programmer, actionPerformed programmatically Hi

Is it good way to programmatically call actionPerformed?
NewAction action = new NewAction();
action.actionPerformed(null); //maybe instead null should be something
else, but what?


Best Regards
Greg


 
Greg





PostPosted: 2003-10-29 18:06:00 Top

java-programmer >> actionPerformed programmatically Hi

Is it good way to programmatically call actionPerformed?
NewAction action = new NewAction();
action.actionPerformed(null); //maybe instead null should be something
else, but what?


Best Regards
Greg


 
Andree Gro遝





PostPosted: 2003-10-29 23:59:00 Top

java-programmer >> actionPerformed programmatically Greg wrote:
> Hi
>
> Is it good way to programmatically call actionPerformed?
> NewAction action = new NewAction();
> action.actionPerformed(null); //maybe instead null should be something
> else, but what?

For example:

listener.actionPerformed(
new ActionEvent(
(Component)source, 10001, "cmd_Exit")
)
);

params: the component which is the source of this event,
for example within a dialog - then it is 'this'
simple id for the ActionEvent
string with ActionCommand

HTH A.G.