package com.wang.second;
import javax.swing.*;
import java.awt.*;
/**
* @author valive
* @create 2021-04-07 16:28
**/
public class JFrameDemo1 extends JFrame{
public static void main(String[] args) {
new JFrameDemo1();
}
public JFrameDemo1(){
Container container = this.getContentPane();
//文本域
JTextArea TextArea = new JTextArea(20,20);
TextArea.setText("欢迎您来到");
//Scroll面板
JScrollPane scrollPane = new JScrollPane(TextArea);
container.add(scrollPane);
this.setVisible(true);
this.setBounds(100,100,200,300);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}
GUI滚动条
package com.wang.second; impor...
生活中的经历