import javax.swing.*;
@SuppressWarnings("serial")
public class jSrcollPane extends JFrame {
JScrollPane jsp;
JTextArea jtf;
public jSrcollPane() {
super("Myjsrcollpane");
this.setSize(400, 300);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
jsp = new JScrollPane();
jtf = new JTextArea(40,40);
jsp.getViewport().add(jtf);
this.getContentPane().add(jsp);
this.setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new jSrcollPane();
}
}
java作业——滚动条
最新推荐文章于 2022-01-10 09:37:47 发布