java – JOptionPane和滚动功能
发布时间:2020-05-25 12:57:15 所属栏目:Java 来源:互联网
导读:我想JList在JOptionPane中的很多结果,但是,我不知道如果添加一个滚动函数应该有太多的结果.如何将滚动条添加到JOptionPane?任何帮助都会很棒. 谢谢. 以下是使用JScrollPane中嵌入的JTextArea的示例: JTextArea textArea = new JTextArea(Insert your Text h
|
我想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); (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
