7fd59977 |
1 | |
2 | //Title: Setup program |
3 | //Version: |
4 | //Copyright: Copyright (c) 1999 |
5 | //Author: User Interface group |
6 | //Company: MatraDatavision |
7 | //Description:Sets graphics configuration. |
8 | |
9 | import javax.swing.UIManager; |
10 | import java.awt.*; |
11 | import java.util.*; |
12 | |
13 | public class setup |
14 | { |
15 | boolean packFrame = false; |
16 | |
17 | //Construct the application |
18 | public setup() |
19 | { |
20 | ResourceBundle AppRes = ResourceBundle.getBundle("properties.AppRes"); |
21 | Locale aLocale = new Locale(AppRes.getString("language"), ""); |
22 | |
23 | Locale.setDefault(aLocale); |
24 | |
25 | SetupFrame frame = new SetupFrame(); |
26 | //Validate frames that have preset sizes |
27 | //Pack frames that have useful preferred size info, e.g. from their layout |
28 | if (packFrame) |
29 | frame.pack(); |
30 | else |
31 | frame.validate(); |
32 | //Center the window |
33 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); |
34 | Dimension frameSize = frame.getSize(); |
35 | if (frameSize.height > screenSize.height) |
36 | frameSize.height = screenSize.height; |
37 | if (frameSize.width > screenSize.width) |
38 | frameSize.width = screenSize.width; |
39 | frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); |
40 | frame.setVisible(true); |
41 | } |
42 | |
43 | //Main method |
44 | public static void main(String[] args) |
45 | { |
46 | try |
47 | { |
48 | UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); |
49 | // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); |
50 | } |
51 | catch(Exception e) |
52 | { |
53 | } |
54 | new setup(); |
55 | } |
56 | } |
57 | |