📄 denglu.java
字号:
import javax.swing.*;
import java.awt.*;
import javax.swing.border.*;
import java.awt.event.*;
class Deng extends Frame implements ActionListener
{
Box baseBox,box1;
Label l1;
Button Xiaoshou, Caimin;
Deng(String s)
{
super(s);
box1=Box.createVerticalBox();
l1=new Label("欢迎使用35选7彩票销售机");
box1.add(l1);
box1.add(Box.createVerticalStrut(10));
Xiaoshou=new Button("销售员");
Xiaoshou.addActionListener(this);
box1.add(Xiaoshou);
box1.add(Box.createVerticalStrut(10));
Caimin=new Button("彩民");
Caimin.addActionListener(this);
box1.add( Caimin);
box1.add(Box.createVerticalStrut(10));
baseBox=Box.createHorizontalBox();
baseBox.add(box1);
baseBox.add(Box.createHorizontalStrut(10));
add(baseBox);
setBackground(Color.green);
setBounds(120,150,250,180);
setLayout(new FlowLayout());
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==Xiaoshou)
{B q=new B("销售员登陆系统");
}
else if(e.getSource()==Caimin)
{Cp w=new Cp("彩民信息界面");
}
}
}
public class Denglu
{
public static void main(String args[])
{
Deng d=new Deng("彩票销售机管理系统");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -