Article View: borland.public.jbuilder.java.language
Article #15142Re: Press Button Automatically
From: gergele
Date: Thu, 01 Jul 1999 00:00
Date: Thu, 01 Jul 1999 00:00
42 lines
2618 bytes
2618 bytes
In article <377A4134.A2CF3783@myriad.com>, Paul Hill <phill@myriad.com> wrote: > > [...] > > 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. I have a little trouble with this answer. I have a main- program and some threads which are invoked by the main- program. Now something happens in a thread, e.g. it has done it's first job. What I want to do is to say 'Hello, main! here I am! Please wake up!'. I thought this to be a classical example for an event- handler. But the doc's which I have don't tell me how to create an event, to send it to the main program, and to 'activate' it. The only Events I find in the doc's (jdk, javasoft tutorials) are the internal java- events. Not that I don't want to have Button- events in my programs, but this whole 20-line-web-stuff doesn't match the aim of a 'real programming language'. I hope someone can help me - Marco Gergele. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7lf12s$4vm$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<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: f74b3,3deb09cf5370bdb2 X-Google-Attributes: gidf74b3,public 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 From: gergele@my-deja.com Subject: Re: Press Button Automatically Date: 1999/07/01 Message-ID: <7lf12s$4vm$1@nnrp1.deja.com> X-Deja-AN: 495896340 References: <7laik7$rg0$1@mailint03.im.hou.compaq.com> <3778DB0B.2B59F8C9@logics.de> <377A4134.A2CF3783@myriad.com> X-Http-Proxy: 1.0 x34.deja.com:80 (Squid/1.1.22) for client 195.206.76.90 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Thu Jul 01 06:16:02 1999 GMT Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.api,comp.lang.java.help X-Http-User-Agent: Mozilla/4.51 [de] (WinNT; I)