JTextPane不包装文本

ash*_*ish 3 java swing jtextpane

我遇到了一个奇怪的问题.我在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;
}
Run Code Online (Sandbox Code Playgroud)

}

Sta*_*avL 5

原因可能是java版本.

请参阅https://forums.oracle.com/forums/thread.jspa?messageID=10690405,讨论并提供解决方法