Multiple input Dialog box

I want to build a multiple input dialog box (for the user to enter 2 integers and a string, for example)...Any suggestions?
[144 byte] By [JAVA-GUY] at [2007-9-26 1:38:36]
# 1

message[0] = new JLabel("Website");

message[1] = JTextField web = new JTextField ("WebSite Address");

message[2] = new JLabel("Username");

message[3] = new JTextField("Username");

message[4] = new JLabel("Password");

message[5] = new JPasswordField();

message[6] = new JLabel("Notes");

message[7] = new JTextField("Notes about site");

String[] options = {"OK", "Cancel"};

int answer = JOptionPane.showOptionDialog(container, message, "New Entry", JOptionPane.DEFAULT_OPTION, OptionPane.INFORMATION_MESSAGE,

null, options, options[0]);

Give OPTION_TYPE as YES_NO_OPTION, or YES_NO_CANCEL_OPTION

Then check the value in the answer

if (answer == Ok_OPTON) {

//HERE ARE THE MULTIPLE INPUTS

Object [] messages = (OBject) JOptionPane.getMessage();

String name = ((JTextField)messges[0]).getText();

....

....

Like that retrive other values

}

else (answer == CANCEL_OPTION) {

user pressed cancel

}

else (answer == CLOSED_OPTION) {

user closed the window

}

Is This U want?

redwin at 2007-6-29 2:26:44 > top of Java-index,Archived Forums,Swing...
# 2
Yeah, smart...I didn't know that you could pass an element table as a parameter .Thanx...
JAVA-GUY at 2007-6-29 2:26:44 > top of Java-index,Archived Forums,Swing...