What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Java question

Java question
Author: Message:
saralk
Veteran Member
*****

Avatar

Posts: 2598
Reputation: 38
35 / Male / Flag
Joined: Feb 2003
O.P. Java question
Hi,

I need to create a simple Java application for my coursework, and i'm having a little trouble.

Basically, i've created a class that deals with all the GUI stuff. And part of the GUI requires a popup dialogue window, that allows for the creation of a new entry.

I don't want to deal with any of the database stuff in the GUI class, so I want the function to return the data that was inputted in the dialogue box when you press OK.

Here is a bit of the code I wrote...

code:
public Contact addContactWindow() {
//opens an add contact dialouge box, returns a Contact object
//SNIP
   
{ //listener for the ok button
  class MenuItemListener implements ActionListener {
   public void actionPerformed(ActionEvent event) {
    //code goes here
   }
  }
  ActionListener listener = new MenuItemListener();
  okButton.addActionListener(listener);
}

}

So when the ok button is pressed, the code in the actionPerformed function will be executed. I can construct a Contact object easily, however I can't figure out how to return it.
The Artist Formerly Known As saralk
London · New York · Paris
Est. 1989
02-06-2008 03:46 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Java question - by saralk on 02-06-2008 at 03:46 PM
RE: Java question - by foaly on 02-06-2008 at 04:10 PM
RE: Java question - by saralk on 02-06-2008 at 04:23 PM
RE: Java question - by foaly on 02-06-2008 at 04:33 PM
RE: Java question - by saralk on 02-06-2008 at 04:42 PM
RE: Java question - by foaly on 02-06-2008 at 04:51 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On