|
18 | 18 |
|
19 | 19 | import cn.enaium.joe.util.LangUtil; |
20 | 20 | import cn.enaium.joe.util.ReflectUtil; |
| 21 | +import net.miginfocom.swing.MigLayout; |
21 | 22 |
|
22 | 23 | import javax.swing.*; |
23 | 24 | import javax.swing.border.EmptyBorder; |
24 | 25 | import javax.tools.ToolProvider; |
25 | | -import java.awt.*; |
26 | 26 |
|
27 | 27 | /** |
28 | 28 | * @author Enaium |
29 | 29 | */ |
30 | 30 | public class AboutDialog extends Dialog { |
31 | 31 | public AboutDialog() { |
32 | 32 | super(LangUtil.i18n("menu.help.about")); |
33 | | - setContentPane(new JPanel(new GridLayout(2, 0)) {{ |
| 33 | + setContentPane(new JPanel(new MigLayout("fillx", "[fill][fill]")) {{ |
34 | 34 | setBorder(new EmptyBorder(10, 10, 10, 10)); |
35 | | - add(new JPanel(new GridLayout(5, 0)) {{ |
36 | | - add(new JLabel(LangUtil.i18n("about.system"))); |
37 | | - add(new JLabel(LangUtil.i18n("about.system.description"))); |
38 | | - add(new JPanel(new BorderLayout()) {{ |
39 | | - add(new JLabel(LangUtil.i18n("about.system.name")), BorderLayout.WEST); |
40 | | - add(new JLabel(System.getProperty("os.name")), BorderLayout.EAST); |
41 | | - }}); |
42 | | - add(new JPanel(new BorderLayout()) {{ |
43 | | - add(new JLabel(LangUtil.i18n("about.system.architecture")), BorderLayout.WEST); |
44 | | - add(new JLabel(System.getProperty("os.arch")), BorderLayout.EAST); |
45 | | - }}); |
46 | | - add(new JSeparator()); |
47 | | - }}); |
48 | | - add(new JPanel(new GridLayout(8, 0)) {{ |
49 | | - add(new JLabel(LangUtil.i18n("about.java"))); |
50 | | - add(new JLabel(LangUtil.i18n("about.java.description"))); |
51 | | - add(new JPanel(new BorderLayout()) {{ |
52 | | - add(new JLabel(LangUtil.i18n("about.java.version")), BorderLayout.WEST); |
53 | | - add(new JLabel(System.getProperty("java.version")), BorderLayout.EAST); |
54 | | - }}); |
55 | | - add(new JPanel(new BorderLayout()) {{ |
56 | | - add(new JLabel(LangUtil.i18n("about.java.vm.name")), BorderLayout.WEST); |
57 | | - add(new JLabel(System.getProperty("java.vm.name")), BorderLayout.EAST); |
58 | | - }}); |
59 | | - add(new JPanel(new BorderLayout()) {{ |
60 | | - add(new JLabel(LangUtil.i18n("about.java.vm.vendor")), BorderLayout.WEST); |
61 | | - add(new JLabel(System.getProperty("java.vm.vendor")), BorderLayout.EAST); |
62 | | - }}); |
63 | | - add(new JPanel(new BorderLayout()) {{ |
64 | | - add(new JLabel(LangUtil.i18n("about.java.home")), BorderLayout.WEST); |
65 | | - add(new JLabel(System.getProperty("java.home")), BorderLayout.EAST); |
66 | | - }}); |
67 | | - add(new JPanel(new BorderLayout()) {{ |
68 | | - add(new JLabel(LangUtil.i18n("about.java.supportCompiler")), BorderLayout.WEST); |
69 | | - add(new JLabel(String.valueOf(ToolProvider.getSystemJavaCompiler() != null)), BorderLayout.EAST); |
70 | | - }}); |
71 | | - add(new JPanel(new BorderLayout()) {{ |
72 | | - add(new JLabel(LangUtil.i18n("about.java.supportAttach")), BorderLayout.WEST); |
73 | | - add(new JLabel(String.valueOf(ReflectUtil.classHas("com.sun.tools.attach.VirtualMachine"))), BorderLayout.EAST); |
74 | | - }}); |
75 | | - }}); |
| 35 | + add(new JLabel(LangUtil.i18n("about.system")), "wrap"); |
| 36 | + add(new JLabel(LangUtil.i18n("about.system.description")), "wrap"); |
| 37 | + |
| 38 | + add(new JLabel(LangUtil.i18n("about.system.name"))); |
| 39 | + add(new JLabel(System.getProperty("os.name")), "wrap"); |
| 40 | + add(new JLabel(LangUtil.i18n("about.system.architecture"))); |
| 41 | + add(new JLabel(System.getProperty("os.arch")), "wrap"); |
| 42 | + |
| 43 | + add(new JSeparator(), "span 2"); |
| 44 | + add(new JLabel(), "wrap"); |
| 45 | + |
| 46 | + add(new JLabel(LangUtil.i18n("about.java")), "wrap"); |
| 47 | + add(new JLabel(LangUtil.i18n("about.java.description")), "wrap"); |
| 48 | + |
| 49 | + |
| 50 | + add(new JLabel(LangUtil.i18n("about.java.version"))); |
| 51 | + add(new JLabel(System.getProperty("java.version")), "wrap"); |
| 52 | + add(new JLabel(LangUtil.i18n("about.java.vm.name"))); |
| 53 | + add(new JLabel(System.getProperty("java.vm.name")), "wrap"); |
| 54 | + add(new JLabel(LangUtil.i18n("about.java.vm.vendor"))); |
| 55 | + add(new JLabel(System.getProperty("java.vm.vendor")), "wrap"); |
| 56 | + add(new JLabel(LangUtil.i18n("about.java.home"))); |
| 57 | + add(new JLabel(System.getProperty("java.home")), "wrap"); |
| 58 | + add(new JLabel(LangUtil.i18n("about.java.supportCompiler"))); |
| 59 | + add(new JLabel(String.valueOf(ToolProvider.getSystemJavaCompiler() != null)), "wrap"); |
| 60 | + add(new JLabel(LangUtil.i18n("about.java.supportAttach"))); |
| 61 | + add(new JLabel(String.valueOf(ReflectUtil.classHas("com.sun.tools.attach.VirtualMachine"))), "wrap"); |
76 | 62 | }}); |
| 63 | + setResizable(false); |
| 64 | + pack(); |
77 | 65 | } |
78 | 66 | } |
0 commit comments