-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLandingPage.java
More file actions
64 lines (48 loc) · 1.53 KB
/
Copy pathLandingPage.java
File metadata and controls
64 lines (48 loc) · 1.53 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
import java.awt.*;
import javax.swing.*;
import javax.swing.ImageIcon;
public class LandingPage extends JFrame //implements ActionListener
{
public static void main (String args[])
{
new LandingPage ();
}
public LandingPage ()
{
JFrame frame = new JFrame ();
JPanel LandingPageMain = (JPanel) frame.getContentPane ();
frame.setSize (600, 400);
JPanel panel = new JPanel (new GridBagLayout ());
GridBagConstraints constraints = new GridBagConstraints ();
ImageIcon Logo = new ImageIcon ("./assets/MonopolyLogo.jpg");
JLabel LogoLabel = new JLabel (Logo);
JButton startButton = new JButton ("START");
JLabel P1Label = new JLabel ("PLAYER ONE");
JLabel P2Label = new JLabel ("PLAYER TWO");
Font currentFont = P1Label.getFont ();
//int newSize = currentFont.getSize () + 2;
Font label = new Font ("Serif", Font.BOLD, 20);
P1Label.setFont (label);
P2Label.setFont (label);
JPanel LogoPane = new JPanel ();
LogoPane.add (LogoLabel);
constraints.gridx = 5;
constraints.gridy = 1;
panel.add (LogoPane, constraints);
constraints.gridx = 5;
constraints.gridy = 2;
panel.add (startButton, constraints);
constraints.gridx = 4;
constraints.gridy = 3;
//constraints.gridheight = 2;
//constraints.gridwidth = 2;
panel.add (P1Label, constraints);
constraints.gridx = 6;
constraints.gridy = 3;
//constraints.gridheight = 2;
//constraints.gridwidth = 2;
panel.add (P2Label, constraints);
LandingPageMain.add (panel);
frame.setVisible (true);
}
}