我遇到了一个奇怪的问题。我有一个
这是我的代码:
JScrollPane
中包含一个 JTextPane
,用于显示分发列表中的大量字符串,并且在使用Eclipse运行程序时正确地换行代码,但是当我使用Java WebStart运行相同的程序时,它停止了文本换行。这是我的代码:
private JScrollPane displayResults(String distributionList) {
// TODO Auto-generated method stub
JTextPane textArea = new JTextPane();
textArea.setText(distributionList);
textArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(textArea);
scrollPane.setPreferredSize( new Dimension( 500, 500 ) );
return scrollPane;
}