InputDialog Box

Hi all...

I wrote the following which upon a button being clicked brings up an input box prompting the user to enter some info. This user input is then appended to the TextArea.

String str = JOptionPane.showInputDialog(null,"Please enter text here","New Input",JOptionPane.QUESTION_MESSAGE);

editor.append(str +"\n" +"PredefinedText");

What I wanted to do was upon the user checking the button for aSERIES of such boxes to be displayed. Therfore the clicking of the button resulting in e.g. 4 input dialog boxes so the user has re-enter 4 times and each of these inputs is added to the TextArea.

Any direction/code/help much appreciated...

[802 byte] By [johrik] at [2007-9-26 4:02:33]
# 1
just put a loop around it
swingfreak at 2007-6-29 12:59:20 > top of Java-index,Desktop,Core GUI APIs...
# 2

Sorry new to this...

Any short sample which can get me going?

I have the dialog to pop-up when the relevant button is pressed and it appends the users input to the JTextArea. But I was aiming for e.g. 2 boxes to pop-up (one after the other) and the input text to be appended.

Thanks very much for your help...

johrik at 2007-6-29 12:59:20 > top of Java-index,Desktop,Core GUI APIs...
# 3

just write

for(int i=0;i<2;i++){

//your code

}

in this case to windows will popup at nearly the same time, except this IDB is a real Dialog

swingfreak at 2007-6-29 12:59:20 > top of Java-index,Desktop,Core GUI APIs...