package work;
import javax.swing.*;
@SuppressWarnings("serial")
public class jTabbedPane extends JFrame {
JTabbedPane jtb;
JTextArea jta1,jta2,jta3;
public jTabbedPane() {
super("Myjtabbedpane");
this.setSize(400,300);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
jtb = new JTabbedPane();
jta1 = new JTextArea("第一个选项卡");
jta2 = new JTextArea("第二个选项卡");
jta3 = new JTextArea("第三个选项卡");
jtb.addTab("第一个选项卡",jta1);
jtb.addTab("第二个选项卡",jta2);
jtb.addTab("第三个选项卡",jta3);
this.getContentPane().add(jtb);
this.setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new jTabbedPane();
}
}
java作业——选项卡
最新推荐文章于 2024-01-16 09:08:30 发布