-
Notifications
You must be signed in to change notification settings - Fork 0
/
TempLoader.java
57 lines (45 loc) · 1.58 KB
/
TempLoader.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
46
47
48
49
50
51
52
53
54
55
56
57
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class TempLoader extends JDialog {
private JPanel contentPane;
private JButton RUNButton;
private JButton buttonOK;
public TempLoader() {
try {
String laf = UIManager.getSystemLookAndFeelClassName();
UIManager.setLookAndFeel(laf);
}
catch(Exception e) {
System.out.println("Error in initializing UI");
}
// Centring the window///////////////
Dimension screenSize = new Dimension(Toolkit.getDefaultToolkit().getScreenSize());
Dimension windowSize = new Dimension(getPreferredSize());
int wdwLeft = screenSize.width / 2 - windowSize.width / 2;
int wdwTop = screenSize.height / 2 - windowSize.height / 2;
pack();
setLocation(wdwLeft, wdwTop);
///////////////////////////////////////
setContentPane(contentPane);
setModal(true);
getRootPane().setDefaultButton(buttonOK);
RUNButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
contentPane.setVisible(false);
dispose();
RaterPage ref = new RaterPage();
ref.pack();
ref.setVisible(true);
}
});
}
public static void main(String[] args) {
TempLoader dialog = new TempLoader();
dialog.pack();
dialog.setVisible(true);
// System.exit(0);
}
}