Help with GUI ?

I have this GUI which has two textboxes and Listbox. I want to have a browse button connected with the first textbox and then I want the submit button connected with the second textbox. That when user hits submit whatever is in second textbox is read and action is done accordingly. Where should I change my code to make this a reality.

I'm a C# developer and is stuck with this Java project....

import javax.swing.*;

publicclass Graphicsextends JFrame

{

JPanel panel;

JLabel nameLabel;

JLabel callLabel;

JLabel calledNumberLabel;

JTextField fileField;

JTextField numberField;

JList list;

publicvoid createGUI()

{

panel=new JPanel();

panel.setLayout(null);

panel.setBounds(0,0,500,500);

nameLabel=new JLabel("Name of data file?");

nameLabel.setBounds(40,20,150,20);

callLabel=new JLabel("Calling number?");

callLabel.setBounds(40,50,150,20);

calledNumberLabel=new JLabel("Called numbers");

calledNumberLabel.setBounds(140,100,150,20);

fileField=new JTextField();

fileField.setBounds(200,20,150,20);

numberField=new JTextField();

numberField.setBounds(200,50,150,20);

String[] data ={"one","two","three","four"};

list =new JList(data);

JScrollPane scrollPane =new JScrollPane(list);

scrollPane.setBounds(50,130,300,100);

scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

panel.add(nameLabel);

panel.add(callLabel);

panel.add(calledNumberLabel);

panel.add(fileField);

panel.add(numberField);

panel.add(scrollPane);

this.getContentPane().add(panel);

}

}

Really appreciate for all the help...

[2699 byte] By [Thukrala] at [2007-11-26 21:23:20]
# 1
Hello,If you need buttons then you should use JButton class.Here are a couple of links that can help you: http://java.sun.com/docs/books/tutorial/uiswing/components/button.html http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JButton.html
virusakosa at 2007-7-10 3:02:37 > top of Java-index,Java Essentials,New To Java...