landfalse.java

来自「包括源代码」· Java 代码 · 共 58 行

JAVA
58
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package testgui;import java.awt.*;import javax.swing.*;import java.awt.event.*;import java.io.*;/** * * @author DancingMoon */public class LandFalse extends JDialog implements ActionListener{        JLabel 提示信息;    JButton 注册,取消;    RagisterMessage message;        public LandFalse(Landing land)    {        super(land,"错误",false);        message=new RagisterMessage(land);        提示信息=new JLabel("你不是合法用户,是否要注册");        注册=new JButton("注册");        取消=new JButton("取消");                this.setLayout(null);        提示信息.setBounds(40, 20, 200, 20);        注册.setBounds(40, 50, 80, 20);        取消.setBounds(130, 50, 80, 20);                注册.addActionListener(this);        取消.addActionListener(this);                this.add(提示信息);        this.add(注册);        this.add(取消);                this.setBounds(220, 220, 250, 120);        this.setVisible(false);    }    public void actionPerformed(ActionEvent e) {        if(e.getSource()==注册)        {            message.setVisible(true);            this.setVisible(false);        }        if(e.getSource()==取消)        {            this.setVisible(false);        }        throw new UnsupportedOperationException("Not supported yet.");    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?