Repository navigation
Expand file tree
/
Copy pathRobotsProgram.java
More file actions
60 lines (53 loc) · 2.25 KB
/
Copy pathRobotsProgram.java
File metadata and controls
60 lines (53 loc) · 2.25 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
package gui;
import log.LogWindowSource;
import log.Logger;
import javax.swing.*;
import java.awt.*;
import java.util.ResourceBundle;
public class RobotsProgram
{
private static ProgramPreferences prefs = new ProgramPreferences();
public static void main(String[] args) {
ResourceBundle bundle = prefs.getBundle();
try {
//UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
UIManager.put("InternalFrameTitlePane.closeButtonText",
bundle.getString("frameTitlePane.closeButtonText"));
UIManager.put("InternalFrameTitlePane.minimizeButtonText",
bundle.getString("frameTitlePane.minimizeButtonText"));
UIManager.put("InternalFrameTitlePane.restoreButtonText",
bundle.getString("frameTitlePane.restoreButtonText"));
UIManager.put("InternalFrameTitlePane.maximizeButtonText",
bundle.getString("frameTitlePane.maximizeButtonText"));
UIManager.put("InternalFrameTitlePane.moveButtonText",
bundle.getString("frameTitlePane.moveButtonText"));
UIManager.put("InternalFrameTitlePane.sizeButtonText",
bundle.getString("frameTitlePane.sizeButtonText"));
} catch (Exception e) {
e.printStackTrace();
}
SwingUtilities.invokeLater(() -> {
MainApplicationFrame frame = new MainApplicationFrame(bundle);
frame.pack();
frame.setVisible(true);
frame.setExtendedState(Frame.MAXIMIZED_BOTH);
});
}
public static void changeBundle(ResourceBundle bundle){
prefs.setBundle(bundle);
}
public static void restart(ResourceBundle bundle, MainApplicationFrame mainFrame){
changeBundle(bundle);
mainFrame.dispose();
SwingUtilities.invokeLater(() -> {
MainApplicationFrame frame = new MainApplicationFrame(bundle);
Logger.getDefaultLogSource().clear();
frame.pack();
frame.setVisible(true);
frame.setExtendedState(Frame.MAXIMIZED_BOTH);
});
}
}