This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Java's gui event system. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java Watch "Java New topic
Author

Java's gui event system.

Arto Pastinen
Ranch Hand

Joined: Dec 13, 2002
Posts: 79
Hello!

How does java's event system internal works?

I'm implementing 3d engine with java, and i want catch mouse events in my polygon. Is it possible without Components?? Or actually i want implement my own class, which behaves like Componet.

Artsi
Vijayendra V Rao
Ranch Hand

Joined: Jul 04, 2004
Posts: 195
Hi,

You can attach action listeners (or any listeners) for a GUI component. You can have your own custom component if you wish.

Internally, the events that get generated on the UI because of user actions, are queued and then piblished on to the listeners that have registered to listen to those components' acions. You may read the EventQueue class which might make things more clear.

And one more suggestion. Its better if you change your display name before Jessica notices it


Vijayendra <br /> <br />"The harder you train in peace, the lesser you bleed in war"
Arto Pastinen
Ranch Hand

Joined: Dec 13, 2002
Posts: 79
Ok. Thnx! I will change my name for Jessica, but it is very common in finland that people have this kind surnames, like "The Great", "Best of"... yeah..
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

"Arto"-
I appreciate your attempt to change your name but its not quite right -- our naming policy needs you to have a first and a last name... AND it should be not obviuosly ficitious. As I'm sure you know, you can change your display name here.

Thanks! I really appreciate it.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Our Swing/AWT forum is the best place to ask questions about events and components and such. I'll move this over there for you.


[Jess in Action][AskingGoodQuestions]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java's gui event system.
 
Similar Threads
Taking screenshot with java applet using java robot class not working
how to get the mouse's position
Reusing code in different applications?
Vacation response..
Naming logger instances