文本域JScroll面板

 

 1 public class JScrollDemo  extends JFrame {
 2     public JScrollDemo(){
 3         Container container = getContentPane();
 4         JTextArea jTextArea=new JTextArea(20,40);
 5         jTextArea.setText("站在屋顶只对风说不想被左右,本来讨厌下雨的天空,知道听见有人说爱我,坐在电影院,,,,,,");
 6         JScrollPane jScrollDemo=new JScrollPane(jTextArea);
 7         setVisible(true);
 8         setBounds(30,30,300,300);
 9         container.add(jScrollDemo);
10     }
11 
12     public static void main(String[] args) {
13         new JScrollDemo();
14     }
15 }

 

posted on 2022-08-07 16:11  大风吹过12138  阅读(24)  评论(0)    收藏  举报

导航