-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFrame.java
21 lines (19 loc) · 837 Bytes
/
Frame.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import javax.swing.JFrame;
public class Frame extends JFrame {
//Creates a basic method that allows for some basic info about the panel to be inputted
//Allows us to save space in Panel.java by simply creating a Frame object
public Frame(){
//adds a panel to the frame
this.add(new Panel());
//sets a title to the GUI (seen in the top left corner)
this.setTitle("Projectile Launcher");
//allows the GUI to close when the 'x' button is clicked (in the top right corner)
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//prevents the GUI from being resized by the user
this.setResizable(false);
//all places all of these elements into the panel
this.pack();
//allows the GUI to be visible
this.setVisible(true);
}
}