🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Event dispatching/trapping!!

#14698
From: EA.
Date: Sat, 14 Aug 1999 00:00
24 lines
1305 bytes
Hi.. I have a problem with this piece of code:
(nodeTF is just a TextField)

void jButton1_actionPerformed(ActionEvent e) {

     long eventTime = (new java.util.Date()).getTime();
     int keyCode = KeyEvent.VK_UNDEFINED;
     KeyEvent keyReleasedEvent = new KeyEvent(this,
KeyEvent.KEY_PRESSED, eventTime,
                          keyCode, KeyEvent.VK_0);
     ActionEvent ae = new
ActionEvent(this,ActionEvent.ACTION_PERFORMED,"asd");
     nodeTF.requestFocus();
     nodeTF.dispatchEvent(keyReleasedEvent);
     nodeTF.dispatchEvent(ae);

  }

Problem: I can dispatch AND trap "KeyEvent" but something is WRONG with
"ActionEvent"! I don't know if the problem is dispatching and/or
trapping the  "ActionEvent"?!!

Thanks for you help!!!!!
Technical Details
Message-ID: <37B5B540.4A5A77E8@magnus.uwaterloo.ca>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,9ab673749ca77d26,start
X-Google-Attributes: gidf74b3,public
From: "EA." <eaabouzo@magnus.uwaterloo.ca>
Subject: Event dispatching/trapping!!
Date: 1999/08/14
Message-ID: <37B5B540.4A5A77E8@magnus.uwaterloo.ca>
X-Deja-AN: 512948207
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Ambiance
Mime-Version: 1.0
Reply-To: eaabouzo@magnus.uwaterloo.ca
Newsgroups: borland.public.jbuilder.java.language