-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTopLevelWindow.java
More file actions
49 lines (37 loc) · 1.31 KB
/
TopLevelWindow.java
File metadata and controls
49 lines (37 loc) · 1.31 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
import java.awt.*;
import javax.swing.*;
public class TopLevelWindow extends JFrame{
public TopLevelWindow() {
//Create and set up the window.
//JFrame mainFrame = new JFrame("Pirex");
super("Pirex");
//mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//JLabel textLabel = new JLabel("I'm a label in the window",SwingConstants.CENTER);
//textLabel.setPreferredSize(new Dimension(300, 100));
//frame.getContentPane().add(textLabel, BorderLayout.CENTER);
//Display the window.
/*
mainFrame.setLocationRelativeTo(null);
mainFrame.setPreferredSize(new Dimension(1000, 600));
mainFrame.setResizable(false);
mainFrame.pack();
mainFrame.setVisible(true);*/
this.setLocationRelativeTo(null);
this.setPreferredSize(new Dimension(1000, 600));
this.setResizable(true);
this.pack();
this.setVisible(true);
//Layout:
this.getContentPane().setLayout(new BorderLayout());
}
//Add new Objects to the content pane
public void add(JComponent o, String layout)
{
this.getContentPane().add(o, layout);
}
/*
public static void main(String[] args) {
createWindow();
}*/
}