zoukankan      html  css  js  c++  java
  • 小组作业进度(只做了大概还未加内容)


    package zuoye;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Window;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.*;

    public class Game {

    protected static final Component dlg = null;

    public static void main(String[] args) {
    // TODO Auto-generated method stub
    JFrame frm = new JFrame("游戏助手");
    frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frm.setLayout(null);

    final JDialog dlg = new JDialog(frm, "游戏小助手");
    dlg.setBounds(445, 220, 200, 150);
    dlg.setLayout(null);
    dlg.setModal(true);

    JLabel userLabel = new JLabel(" 用 户: ");
    userLabel.setBounds(40, 20, 80, 30);
    JLabel userLabel1 = new JLabel();
    userLabel1.setText(" 密 码:");
    userLabel1.setBounds(40, 50, 80, 30);

    JTextField userText = new JTextField();
    userText.setEditable(true);
    userText.setHorizontalAlignment(SwingConstants.LEFT);
    userText.setColumns(20);
    userText.setBounds(110, 20, 120, 30);

    JButton obtn = new JButton("登陆");
    obtn.setBounds(60, 100, 60, 30);
    obtn.addActionListener(new ActionListener(){
    @Override
    public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    dlg.setVisible(true);
    }
    });
    frm.add(obtn);


    JButton btn = new JButton("选择");
    btn.setBounds(50, 50, 100, 30);
    btn.addActionListener(new ActionListener(){

    @Override
    public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    dlg.setVisible(false);
    }
    });
    dlg.add(btn);

    final JDialog dlg1 = new JDialog(frm, "欢迎注册");
    dlg1.setBounds(450, 220, 200, 150);
    dlg1.setLayout(null);
    dlg1.setModal(true);
    JTextField userText1 = new JTextField();
    userText1.setEditable(true);
    userText1.setHorizontalAlignment(SwingConstants.LEFT);
    userText1.setColumns(20);
    userText1.setBounds(110, 50, 120, 30);
    JButton obtn1 = new JButton("注册");
    obtn1.setBounds(160, 100, 60, 30);
    obtn1.addActionListener(new ActionListener(){
    @Override
    public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    dlg1.setVisible(true);
    }
    });
    frm.add(obtn1);

    JButton btn1 = new JButton("游戏");
    btn1.setBounds(50, 50, 100, 30);
    btn1.addActionListener(new ActionListener(){

    @Override
    public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    dlg1.setVisible(false);
    }
    });
    dlg1.add(btn1);

    frm.add(userLabel);
    frm.add(userText);
    frm.add(userLabel1);
    frm.add(userText1);

    frm.setBounds(400, 200, 300, 200);
    frm.setVisible(true);

    }

    }

  • 相关阅读:
    测试框架Mockito使用笔记
    Apache-Shiro+Zookeeper系统集群安全解决方案之缓存管理
    C#学习笔记-数据的传递以及ToolStripProgressBar
    如果我们不曾相遇
    C#学习笔记-数据的传递(公共变量)以及Dictionary
    C#学习笔记-icon托盘图标的简单知识
    C#学习笔记-Windows窗体基本功能(Login登录界面)
    CellSet 遍历
    DevExpress PivotGrid 使用记录
    Funsioncharts 线图 破解
  • 原文地址:https://www.cnblogs.com/zyw80/p/5538074.html
Copyright © 2011-2022 走看看