Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2007, 02:16 PM
Member
 
Join Date: Jun 2007
Posts: 21
ai_2007 is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-02-2007, 02:36 PM
JavaBean's Avatar
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)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
An interface extending an interface(II) JavaForums Java Blogs 0 03-12-2008 04:00 PM
An interface extending an interface(I) JavaForums Java Blogs 0 03-12-2008 04:00 PM
Linking of exe files archu2friends JavaServer Pages (JSP) and JSTL 0 02-06-2008 07:08 AM
Interface extending Interface JavaForums Java Blogs 0 12-04-2007 02:20 PM
<URGENT> problem after linking .jnlp bongia New To Java 14 11-18-2007 06:57 PM


All times are GMT +3. The time now is 04:09 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org