📄 tabpane1.java
字号:
import java.awt.*;import javax.swing.*;import java.awt.event.*;import javax.swing.event.*;public class tabpane1 extends JFrame { JPanel cp=new JPanel(); JTabbedPane jtp=new JTabbedPane(); Jp1 jp1=new Jp1(); Jp2 jp2=new Jp2(); Jp3 jp3=new Jp3(); public tabpane1() { setTitle("南昌市公交查询系统"); setSize(500,300); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); cp=(JPanel)this.getContentPane(); ImageIcon icon=new ImageIcon("middle.gif"); jtp.add(jp1,0); jtp.setTitleAt(0,"换乘查询"); jtp.add(jp2,1); jtp.setTitleAt(1,"线路查询"); jtp.add(jp3,2); jtp.setTitleAt(2,"站点查询"); jtp.setSelectedIndex(0); cp.add(jtp); } public static void main(String[] args) { tabpane1 tabpane2 = new tabpane1(); tabpane2.setVisible(true); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -