File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java Watch "Java New topic

Java's gui event system.

Arto Pastinen
Ranch Hand

Joined: Dec 13, 2002
Posts: 79

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.

Vijayendra V Rao
Ranch Hand

Joined: Jul 04, 2004
Posts: 195

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

Joined: Oct 17, 2001
Posts: 4313

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

Joined: Jul 08, 2003
Posts: 24195

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]
I agree. Here's the link:
subject: Java's gui event system.
It's not a secret anymore!