This is my code:
JTextArea textArea = new JTextArea(15, 20);
JScrollPane s = new JScrollPane(textArea,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
And I'm adding the text area:
add(textArea);
将JScrollPane
而不是JTextArea
添加到您的容器中:
add(s);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.