java – JOptionPane和滚动功能

我想JList在JOptionPane中的很多结果,但是,我不知道如果添加一个滚动函数应该有太多的结果.如何将滚动条添加到JOptionPane?任何帮助都会很棒.

谢谢.

解决方法

以下是使用JScrollPane中嵌入的JTextArea的示例:
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);

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...