Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2005, 10:17 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default firing an ActionEvent ...

... from an object that implements ActionListener

Just a quick one, I'm working on a Pong applet at the moment ( see http://charlieharvey.org.uk/cgi-bin/...?seen=1&uid=44 ).

There's a Pong object which extends JPanel and implements ActionListener, and a PongApplet object which extends JApplet and implements ActionListener, too.

I'd like to be able to fire an ActionEvent from the Pong object when the game finishes so that the PongApplet is able to update the scores, but I'm guessing that the Pong's ActionListener will catch the ActionEvent.

Anyone know off the top of their heads the best way for my PongApplet to be able to listen to my Pong object?

Feel free to tell me to STFW - I had a late hacking session and can't wuite face fiddling with code til tomorrow anyhow...

Charlie


--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
__________________
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
 
Old May 12th, 2005, 12:21 PM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try out the observer interface which let us change the other class's object when change occurs in one class.

take care

HumaMunir





Similar Threads
Thread Thread Starter Forum Replies Last Post
Events are not firing msrnivas .NET Web Services 14 April 21st, 2008 06:37 AM
Events not firing in IE malk ASP.NET 1.0 and 1.1 Professional 7 August 29th, 2006 01:32 PM
Firing Blanks... ozPATT Access VBA 11 January 20th, 2006 11:26 AM
Mysql not firing up ricbenson MySQL 1 February 6th, 2005 07:05 PM
DropDownList not firing pbyrum ASP.NET 1.0 and 1.1 Basics 7 October 12th, 2004 11:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.