I want to JList a lot of results in a JOptionPane, however, I\'m not sure how to add in a scroll function should there be too many results. How would I add a scroll bar to a JOp
Here is an example using a JTextArea
embedded in a JScrollPane
:
JTextArea textArea = new JTextArea("Insert your Text here");
JScrollPane scrollPane = new JScrollPane(textArea);
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
scrollPane.setPreferredSize( new Dimension( 500, 500 ) );
JOptionPane.showMessageDialog(null, scrollPane, "dialog test with textarea",
JOptionPane.YES_NO_OPTION);