我想让 JTextArea 可滚动...
我尝试了以下代码..但不明白为什么它不起作用...请帮助!
jacontactsDeatil = new JTextArea();
jspn = new JScrollPane();
jspn.setLayout(null);
jspn.setBounds(10, 170, 950, 300);
jspn.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
jspn.isWheelScrollingEnabled();
jspn.setVisible(true);
jspn.setAutoscrolls(true);
jspn.setEnabled(true);
jspn.setBackground(Color.orange);
jspn.add(jacontactsDetail);
jspn.repaint();
jacontactsDetail.setBounds(0,0,jspn.getWidth(),jspn.getHeight());