Quick question...

Hey,Is it possible to have a JTextArea in a JOptionPane?Basically im looking for a way to get input from a user but the input is quite big, so needs more than one line to input.
[198 byte] By [H2-A1a] at [2007-10-2 6:08:11]
# 1
I think use a JDialog and put an JTextArea on it.
buckfast_beekeepera at 2007-7-16 13:08:45 > top of Java-index,Java Essentials,Java Programming...
# 2
Try it out. If it won't work, my standarddialog.java class (google for it. I'm on the first page, the one with package tjacobs) can definitely do this.
tjacobs01a at 2007-7-16 13:08:45 > top of Java-index,Java Essentials,Java Programming...
# 3

what won't work? JTextArea in a JOptionPane? Have you no imagination? This works for me...

String msg = "Tell me your deepest, darkest secret:";

JTextArea ta = new JTextArea(8, 35);

JScrollPane jsp = new JScrollPane(ta);

int res = JOptionPane.showConfirmDialog(f, new Object[]{msg, jsp},

"I wanna know...", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);

if(res == JOptionPane.OK_OPTION) {

System.out.println(ta.getText());

}

bsampieria at 2007-7-16 13:08:45 > top of Java-index,Java Essentials,Java Programming...
# 4
YOU THE MAN, OR THE WOMAN!!cheers!
H2-A1a at 2007-7-16 13:08:45 > top of Java-index,Java Essentials,Java Programming...