importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjava.util.*;importjavax.swing.event.*;classbooking_manageextendsJFrameimplementsActionListener{publicsta...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import javax.swing.event.*;
class booking_manage extends JFrame
implements ActionListener
{
public static void main(String[] args) {
new booking_manage();
}
JMenuBar jm =new JMenuBar();//创建一个工具条对象
JMenu jm1 =new JMenu("0000");//创建文件菜单对象
JMenu jm5=new JMenu("0000");//创建文件菜单对象
JMenuItem jm51=new JMenuItem("0000");//创建菜单项对象
Container con=new Container();
JLabel label=new JLabel("0000",JLabel.CENTER);
JPanel pCenter=new JPanel();
public booking_manage()
{
this.setTitle("0000");
this.setLayout(new CardLayout());
con=getContentPane();
pCenter.setLayout(new CardLayout());
label.setFont(new Font("TimesRoman",Font.BOLD,24));
label.setForeground(Color.red);
this.setJMenuBar(jm);//设置工具条、菜单及菜单项
jm.add(jm1);
jm5.add(jm51);
jm51.addActionListener(this);
con.add(pCenter,BorderLayout.CENTER);
con.validate();
this.setBounds(350,150,700,500);
this.setVisible(true);
addWindowListener(new WindowAdapter()//设置事件监听
{ public void windowClosing(WindowEvent e)
{
System.exit(0);//关闭窗口
}
});
}
public void actionPerformed(ActionEvent e)//设置监听事件处理
{
;
}
}
展开