-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsernameSet.java
More file actions
55 lines (54 loc) · 1.19 KB
/
Copy pathUsernameSet.java
File metadata and controls
55 lines (54 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class UsernameSet implements ActionListener
{
JFrame f3;
JLabel luser1,luser2,head;
JButton b,b1;
JTextField tuser1,tuser2;
public UsernameSet()
{
f3=new JFrame();
f3.setSize(500,300);
f3.setVisible(true);
f3.setResizable(false);
f3.setLayout(null);
f3.setDefaultCloseOperation(f3.HIDE_ON_CLOSE);
b=new JButton("CONTINUE");
b1=new JButton("EXIT");
head=new JLabel("Enter the Choices");
luser1=new JLabel("Enter username 1: ");
luser2=new JLabel("Enter username 2: ");
tuser1=new JTextField();
tuser2=new JTextField();
head.setBounds(10,50,110,40);
luser1.setBounds(10,100,110,20);
luser2.setBounds(10,140,110,20);
tuser1.setBounds(120,100,110,20);
tuser2.setBounds(120,140,110,20);
b.setBounds(180,200,110,30);
b1.setBounds(310,240,100,20);
f3.add(head);
f3.add(luser1);
f3.add(tuser1);
f3.add(luser2);
f3.add(tuser2);
f3.add(b);
f3.add(b1);
b.addActionListener(this);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==b)
{
new Xo(0,0,tuser1.getText(),tuser2.getText());
f3.dispose();
}
else
{
System.exit(0);
}
}
}