• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionEvent

 
Al Finlay
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to understand the sequence involved here -

Netbeans auto-generated code stub for a button named convert


where is the code that generates the ActionEvent object passed to this method?

 
Darryl Burke
Bartender
Posts: 5131
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Drop the visual designer. As you're discovering, it's not a beginners' tool.

Go through this tutorial: How to Write an Action Listener.
 
Al Finlay
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I'm not explaining myself very well. Take this small example:



The code in itself does not reveal the mechanics of what is actually happening here. It reminds me of jQuery functions .. but I can understand that because I can look at the underlying jQuery scripts.
Is the JVM automatically catching all events and passing them to any available methods? Is there no intermediary code?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Al Finlay wrote:Is the JVM automatically catching all events and passing them to any available methods? Is there no intermediary code?

The events are triggered in the JTextField, or some parent of the JTextField. The code is part of core Java, you will probably find it in the src.zip file (found inside your JDK folder). It might requires some digging though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic