import java.awt.Container;
import javax.swing.*;
public class Main extends JFrame{
public Main() {
setBounds(100, 100, 500, 300);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
Container c = getContentPane();
JTextArea t = new JTextArea();//文本域
JScrollPane j = new JScrollPane(t);//创建滚动面板,给文本域添加滚动条
c.add(j);
}
public static void main(String[] args) {
new Main();
}
}
JScrollPane面板(是带有滚动条的面板)(简单代码的例子实现)
最新推荐文章于 2022-04-23 22:57:26 发布