publicclassjiemianextendsJFrameimplementsActionListener{inttotal=0,now=0;JFramejf;JLabeljr,jl,jl1,j2,jl2,j3,jl3;JTextFieldjr4;JPasswordFieldjpf;JButtonjb,jb1,jb2,j1;JPane...
public class jiemian extends JFrame implements ActionListener{
int total=0,now=0;
JFrame jf;
JLabel jr,jl,jl1,j2, jl2,j3,jl3;
JTextField jr4;
JPasswordField jpf;
JButton jb,jb1,jb2,j1;
JPanel jp,jp1,jp2;
public jiemian(){
setLayout(null);
jf = new JFrame("银行叫号程序");//窗体
jr = new JLabel("请**号到*号窗口办理业务");
jr.setBounds(300, 10, 800, 50);
jr.setForeground(Color.red);
j1 =new JButton("取号");
jr4 =new JTextField("取号显示器");
ButtonGroup bg = new ButtonGroup();
bg.add(j1);
jp = new JPanel();
jl = new JLabel("一号窗口");
jl1 = new JLabel("一号窗口,欢迎你!");
jb =new JButton("下一位");
jb.addActionListener(this);
jp.setBackground(Color.pink);
jp.setSize(200, 80);//大小
jp.setLocation(20,120); //位置
jf.setLayout(null);
jp1 = new JPanel();
j2 = new JLabel("二号窗口");
jl2 = new JLabel("**正在办理业务。。。");
jb1 =new JButton("下一位");
jb1.addActionListener(this);
jp1.setBackground(Color.pink);
jp1.setSize(200, 80);//大小
jp1.setLocation(250,120); //位置
jf.setLayout(null);
jp2 = new JPanel();
j3 = new JLabel("三号窗口");
jl3 = new JLabel("**正在办理业务。。。");
jb2 =new JButton("下一位");
jb2.addActionListener(this);
jp2.setBackground(Color.pink);
jp2.setSize(200, 80);//大小
jp2.setLocation(500,120); //位置
jf.setLayout(null);
jf.add(jp);
jf.add(jp1);
jf.add(jp2)
jf.add(jr)
jp.add(jl);
jp.add(jl1);
jp.add(jb)
jp1.add(j2);
jp1.add(jl2);
jp1.add(jb1)
jp2.add(j3);
jp2.add(jl3);
jp2.add(jb2);
jf.add(j1);
jf.add(jr4);
j1.setBounds(550, 300, 60, 30);
jr4.setBounds(300, 300, 200, 40);
jf.setSize(800, 600);
jf.setVisible(true);
}
public void actionPerformed(ActionEvent e){
String s ="";
if(e.getSource()==jb){
s="请"+(++now)+"号顾客到一号窗口办理";
jr.setText(s);
else if(e.getSource()==jb1){
s="请"+(++now)+"号顾客到二号窗口办理";
jr.setText(s);
else if(e.getSource()==jb2){
s="请"+(++now)+"号顾客到三号窗口办理";
jr.setText(s);
public static void main(String[] args) {
new jiemian();
展开