Results 1 to 2 of 2
Thread: Linking code to GUI Interface
- 07-02-2007, 01:16 PM #1
Member
- Join Date
- Jun 2007
- Posts
- 21
- Rep Power
- 0
Linking code to GUI Interface
I have a GUI Interface with Add, Edit, Delete, Filter, Sort, Search methods.
How do I connect the coding for each of the methods above to the GUI Interface so that when the buttons are pressed, the correct method is called and the required output is seen.
Let's say that I want to add an information or filter something. When I click the appropriate button on the GUI Interface, the correct option has to pop up for me to do what I want to do, in this case, add or filter.
- 07-02-2007, 01:36 PM #2
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)
Similar Threads
-
Linking of exe files
By archu2friends in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-06-2008, 06:08 AM -
<URGENT> problem after linking .jnlp
By bongia in forum New To JavaReplies: 14Last Post: 11-18-2007, 05:57 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks