1
我不明白为什么这不起作用......它隐藏了JTextArea。JScrollPane隐藏文本区域
JTextArea _area=new JTextArea();
_area.setBounds(10, 10, 465, 250);
add(_area);
JScrollPane scroller=new JScrollPane(_area);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
add(scroller);
因为我在组件上使用setBounds(),所以我在框架上设置了setLayout(null)。 – Luka
我编辑了答案。 – Prasad
非常感谢你,我不知道。它帮助了! :) – Luka