๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15143

Re: Press Button Automatically

#15143
From: Eitzenberger Thomas
Date: Thu, 01 Jul 1999 00:00
29 lines
2608 bytes
Paul Hill wrote:

> Henning Halfpap wrote:
> >
> > MJ wrote:
> > >
> > > Does anyone know how I can "press" a button in my code...I have a button
> > [...]
> > Depending on that you usually divert to a method which actually performs
> > the action for your object, e.g.
> >
> > if (myEvent.getSource == myButton) actionMyButton(myEvent);
> >
> > so the method actionMyButton(java.awt.event.ActionEvent myEvent) is the
> > one you want to call if the "Enter" Key is pressed.
>
> And if you wrote actionMyButton yourself, you might even be able to
> determine if it really needs an event or can just be called with a null.
>
> When I find myself wanting to do the same as GUI event, I make sure that
> all of real activity of the event is inside of one non-GUI method of
> the class.  When this is the case, any part of the code can call it.
>
> --
> Paul A. Hill, Myriad Genetics Laboratories, http://www.myriad.com/

or you start using swing which has a doClick() method for JButtons #>)

mfg ET
Technical Details
Message-ID: <377AFC0D.46550082@siemens.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7laik7$rg0$1@mailint03.im.hou.compaq.com> <3778DB0B.2B59F8C9@logics.de> <377A4134.A2CF3783@myriad.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5d71,3deb09cf5370bdb2
X-Google-Attributes: gidf5d71,public
X-Google-Thread: fecd1,3deb09cf5370bdb2
X-Google-Attributes: gidfecd1,public
X-Google-Thread: 113ae9,3deb09cf5370bdb2
X-Google-Attributes: gid113ae9,public
X-Google-Thread: fa45f,3deb09cf5370bdb2
X-Google-Attributes: gidfa45f,public
X-Google-Thread: 111d6b,3deb09cf5370bdb2
X-Google-Attributes: gid111d6b,public
X-Google-Thread: 10bb9b,3deb09cf5370bdb2
X-Google-Attributes: gid10bb9b,public
X-Google-Thread: f74b3,3deb09cf5370bdb2
X-Google-Attributes: gidf74b3,public
X-Google-Thread: 10a146,3deb09cf5370bdb2
X-Google-Attributes: gid10a146,public
From: Eitzenberger Thomas <Thomas.Eitzenberger@siemens.at>
Subject: Re: Press Button Automatically
Date: 1999/07/01
Message-ID: <377AFC0D.46550082@siemens.at>
X-Deja-AN: 495897136
Content-Transfer-Encoding: 7bit
References: <7laik7$rg0$1@mailint03.im.hou.compaq.com> <3778DB0B.2B59F8C9@logics.de> <377A4134.A2CF3783@myriad.com>
To: Paul Hill <phill@myriad.com>
X-Accept-Language: hr,en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@siemens.at
X-Trace: scesie13.sie.siemens.at 930806978 24619 195.15.5.61 (1 Jul 1999 05:29:38 GMT)
Organization: Siemens AG ร–sterreich
Mime-Version: 1.0
NNTP-Posting-Date: 1 Jul 1999 05:29:38 GMT
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.api,comp.lang.java.help,comp.lang.java.machine,comp.lang.java.misc,comp.lang.java.programmer,microsoft.public.inetexplorer.ie4.java_applets