Article View: borland.public.jbuilder.java.swing
Article #12699Re: When is getActionCommand used ?
From: Matt Krevs
Date: Tue, 01 Dec 1998 00:00
Date: Tue, 01 Dec 1998 00:00
27 lines
1371 bytes
1371 bytes
Typically, you have an ActionListener that listens to a number of components
that generate ActionEvents.
getActionCommand() can then used to work out what component generated the
event
Unfortunately, if you use the JBuilder visual designer then an
actionlistener is created for every button that generates action events and
getActionCommand() becomes redundant.
Michael Nguyen wrote in message <3662EE39.91524673@home.com>...
>The swing components have actionCommand that can be retrieved via
>getActionCommand as
>in the example below. When jButton is clicked, its event handler
>'actionPerformed'
>is called and I already know that jButton1 is clicked. So when is
>getActionCommand
>needed ? Thanks for the info.
>
>Michael,
>
> void jButton1_actionPerformed (ActionEvent e)
> {
> System.out.println (e.getActionCommand ());
> }
>
>
Technical Details
Message-ID:
<73vahi$mhd5@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3662EE39.91524673@home.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c56198fc8ddd4631 X-Google-Attributes: gid111d45,public From: "Matt Krevs" <mattkrevs@flex.com.au> Subject: Re: When is getActionCommand used ? Date: 1998/12/01 Message-ID: <73vahi$mhd5@forums.borland.com> X-Deja-AN: 417276399 References: <3662EE39.91524673@home.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing