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 ("Game assistant");
Frm.setdefaultcloseoperation (Jframe.exit_on_close);
Frm.setlayout (NULL);
Final JDialog dlg = new JDialog (frm, "Game Little Helper");
Dlg.setbounds (445, 220, 200, 150);
Dlg.setlayout (NULL);
Dlg.setmodal (TRUE);
JLabel Userlabel = new JLabel ("User:");
Userlabel.setbounds (40, 20, 80, 30);
JLabel UserLabel1 = new JLabel ();
Userlabel1.settext ("Password:");
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 ("login");
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 ("select");
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, "Welcome to register");
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 ("registration");
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 ("game");
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);
}
}
Group work progress (only about not yet added content)