Scroll Bar

I'm writing a GUI program. I have a method that returns some large strings, and sometimes the strings are too large for the

JOptionPane.showMessageDialog(null,ouput);

to fit on the screen. Is there a simple way I can get a new window to pop up like the

showMessageDialog

method does, but instead of going out of the screen, it has a simple scroll bar, and nice height?

Any help appreciated.

[429 byte] By [imdandmana] at [2007-11-27 9:23:14]
# 1

JTextArea ta = new JTextArea(5,10);

ta.setLineWrap(true);

ta.setWrapStyleWord(true);

ta.setText(output);

JOptionPane.showMessageDialog(null,new JScrollPane(ta));

Michael_Dunna at 2007-7-12 22:18:14 > top of Java-index,Java Essentials,Java Programming...