-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrainvita.java
More file actions
65 lines (50 loc) · 1.19 KB
/
Copy pathBrainvita.java
File metadata and controls
65 lines (50 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
56
57
58
59
60
61
62
63
64
65
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Brainvita extends JFrame implements ActionListener
{
JPanel p1,p2,p3;
JTextField t;
JButton b,h;
JLabel l,la,imgl;
ImageIcon img = new ImageIcon("images/Brainvita.jpg");
Brainvita()
{
super("Brainvita");
p1 = new JPanel();
p2 = new JPanel();
p3 = new JPanel();
setLayout(new BorderLayout());
b = new JButton("Play Now");
b.addActionListener(this);
l = new JLabel ("ENTER YOUR NAME");
t = new JTextField(18);
la = new JLabel ("@copyleft all wrongs reserved");
imgl = new JLabel(img);
imgl.setPreferredSize(new Dimension(400,200));
p1.add(imgl);
p2.setLayout(new FlowLayout());
p2.add(l);
p2.add(t);
p2.add(b);
p3.add(la);
add(p1,BorderLayout.NORTH);
add(p2,BorderLayout.CENTER);
add(p3,BorderLayout.SOUTH);
setSize(420,500);
setVisible(true);
setBounds(new Rectangle(275,175,420,500));
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public void actionPerformed (ActionEvent e)
{
setVisible(false);
Board b = new Board();
Timer ti = new Timer(b);
b.setPlayer(t.getText());
}
public static void main (String args[])
{
new Brainvita();
}
}