thanks Gregg, I tried your suggestion but i seem not to get it to work. below is a skeleton of the code i wrote maybe it could give you an idea of what i'm working with.
public class MyFrame extends JFrame implements ActionListener {
private JTextField emp_name;
private JTextField emp_address
.
.
private JButton choose
public MyFrame() {
emp_name = new JTextField(10);
// add name to layout manager
choose = new JButton("Select Employee");
// add choose to layout manager
choose.addactionlistener(this);
.
.
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == choose) {
JDialog dialog = new MyDialog(this,"Title",true);
}
}
now the dialog class...
public class MyDialog extends JDialog implements MouseListener{
// declare variables
private Jlist mylist;
.
.
public MyDialog(Frame frame,
String title, boolean bo) {
// set up the JList and retrieve data from
// database into list
mylist.addMouseListener(this);
}
public void mousePressed(MouseEvent e) {
// get number of clicks
mylist.getSelectedIndex();
// get data from database about name selected
// **how do i load data from database into emp_name and emp_address??
}
}