0
无文字区域反正有一个JOptionPane的窗口没有文本区域,但只有一个滚动条,在JOptionPane的窗口
JTextArea listBox = new JTextArea(aLineFromFile);
JScrollPane scroll = new JScrollPane(listBox);
listBox.setLineWrap(true);
listBox.setWrapStyleWord(true);
scroll.setPreferredSize(new Dimension(200, 400));
JOptionPane.showMessageDialog(null, scroll, "Dictionary enteries", JOptionPane.PLAIN_MESSAGE);
我不希望我只是想文本后面的白色背景上做滚动条。 或者无论如何使文本区域中的文本不可编辑。