View Single Post
  #2 (permalink)  
Old 07-02-2007, 03:36 PM
JavaBean's Avatar
JavaBean JavaBean is offline
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
As an abstract description:

You will have a data class which will hold your data and a view class (e.g. your jframe). You will register event listeners in your GUI and these event listeners (e.g. listener which listens for mouse clicks on certain components) will obtain necessary data from GUI elements (e.g. getting input from the user via a textfield) and call required methods of your data class to change the data. If you dont need to change data and just need to change representation, the listeners will call GUI methods instead of methods of your data class.

Here you can find list of listeners and events in Swing:

javax.swing.event (Java 2 Platform SE v1.4.2)

And here is a tutorial for listeners:

Lesson: Writing Event Listeners (The Java™ Tutorials > Creating a GUI with JFC/Swing)
Reply With Quote