-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwelcome.java
73 lines (68 loc) · 1.65 KB
/
welcome.java
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package brain.booster;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.*;
import javax.swing.*;
/**
*
* @author SAPNA
*/
public class welcome implements ActionListener
{
JFrame j;
public static void main(String[] arg)
{
new welcome();
}
welcome()
{
j=new JFrame();
JLabel l=new JLabel();
JLabel l1=new JLabel();
l.setBounds(30,130,320,80);
l1.setBounds(0,0,400,400);;
JButton b=new JButton("Login");
JButton b1=new JButton("Signup");
JButton b2=new JButton("How to Play");
b.addActionListener(this);
b1.addActionListener(this);
b2.addActionListener(this);
b.setBounds(165,260,70,25);
b1.setBounds(160,300,80,25);
b2.setBounds(270,20,100,25);
l.setIcon(new ImageIcon("C:\\Users\\ADMIN\\Documents\\w1.gif"));
l1.setIcon(new ImageIcon("C:\\Users\\ADMIN\\Documents\\star1.gif"));
j.setLayout(null);
j.setTitle("WELCOME");
j.setSize(400,400);
j.setLocation(700,250);
j.add(b);
j.add(b1);
j.add(b2);
j.add(l);
j.add(l1);
j.setVisible(true);
j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
@Override
public void actionPerformed(ActionEvent ae)
{
String name=ae.getActionCommand();
if(name.equals("Login"))
{
new login();
j.dispose();
}
else if(name.equals("Signup"))
{
new signup();
j.dispose();
}
else
{
new Instructions();
j.dispose();
}
}
}