-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaunchPage.java
More file actions
75 lines (56 loc) · 1.87 KB
/
LaunchPage.java
File metadata and controls
75 lines (56 loc) · 1.87 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
66
67
68
69
70
71
72
73
74
75
// Importing the java swing package
import javax.swing.*;
// Importing the java awt package
import java.awt.*;
// Importing the java awt event package
import java.awt.event.*;
// Declaring a class called LaunchPage
public class LaunchPage implements ActionListener
{
// Creating a frame with a title
JFrame frame = new JFrame("PERSONAL TV/MOVIE DATABASE");
// Creating a button
JButton button = new JButton();
// Creating a constructor
LaunchPage()
{
// Adding image on the button
button.setIcon(new ImageIcon("Start Image.png"));
// Positioning and setting the size of the button
button.setBounds(26, 43, 560, 160);
// Setting the focusable of the button
button.setFocusable(false);
// Adding the action listener to the button
button.addActionListener(this);
// Setting the size of the frame
frame.setSize(610, 280);
// Setting the layout of the frame
frame.setLayout(null);
// Adding the button to the frame
frame.add(button);
// Setting the font of the frame text
frame.setFont(new Font(null, Font.BOLD, 25));
// Setting the default close operation of the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Setting the location of the frame
frame.setLocationRelativeTo(null);
// Setting the frame to visible
frame.setVisible(true);
// Outputting a blank line
System.out.println();
// Informing the user that they need to click the start button in order to proceed
System.out.println("Press the START button when you are ready to begin.");
}
@Override
public void actionPerformed(ActionEvent e)
{
// Condition to check if the button is clicked
if(e.getSource() == button)
{
// Disposing the frame
frame.dispose();
// Instantiating an object of class PopUpWindow
PopUpWindow puw = new PopUpWindow();
}
}
}