-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNewFrame.java
45 lines (34 loc) · 1.1 KB
/
NewFrame.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
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class NewFrame extends JFrame {
private JFrame frame;
private JPanel masterPanel;
private BackgroundPanel backgroundImage;
private UserPlanePanel userPlane;
public NewFrame(){
// Creates the frame.
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
masterPanel = new JPanel();
masterPanel.setLayout( new OverlayLayout(masterPanel) );
masterPanel.setPreferredSize(new Dimension(4000,4000));
init();
frame.getContentPane().add(masterPanel);
}
public void init(){
backgroundImage = new BackgroundPanel();
userPlane = new UserPlanePanel();
userPlane.setOpaque(false);
backgroundImage.setOpaque(false);
masterPanel.add(userPlane);
masterPanel.add(backgroundImage);
//frame.getContentPane().add(userPlane);
//frame.getContentPane().add(backgroundImage);
}
// Shows the frame.
public void display(){
frame.pack();
frame.setVisible(true);
}
}