1 12 13 package org.ejtools.jmx.browser; 14 15 16 17 import java.awt.BorderLayout ; 18 19 import java.awt.Color ; 20 21 import java.awt.Container ; 22 23 import java.awt.GridLayout ; 24 25 import java.util.ResourceBundle ; 26 27 28 29 import javax.swing.ImageIcon ; 30 31 import javax.swing.JLabel ; 32 33 import javax.swing.JPanel ; 34 35 import javax.swing.SwingConstants ; 36 37 import javax.swing.UIManager ; 38 39 40 41 import org.ejtools.adwt.service.AboutService; 42 43 44 45 60 61 public final class AboutDialog implements AboutService 62 63 { 64 65 66 67 private JPanel panel = null; 68 69 70 71 private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.jmx.browser.Resources"); 72 73 74 75 76 77 78 79 public AboutDialog() 80 81 { 82 83 super(); 84 85 } 86 87 88 89 90 91 100 101 public Container getPanel() 102 103 { 104 105 if (this.panel == null) 106 107 { 108 109 this.createPanel(); 110 111 } 112 113 114 115 return this.panel; 116 117 } 118 119 120 121 122 123 132 133 public String getTitle() 134 135 { 136 137 return resources.getString("about.dialog.title"); 138 139 } 140 141 142 143 144 145 146 147 protected void createPanel() 148 149 { 150 151 this.panel = new JPanel (new BorderLayout ()); 152 153 154 155 157 this.panel.add("North", new JLabel (new ImageIcon (getClass().getResource("/images/logo.png")))); 158 159 160 161 163 this.panel.add("Center", new JLabel (" ")); 164 165 166 167 169 JPanel info = new JPanel (new GridLayout (3, 1)); 170 171 172 173 JLabel java = new JLabel ( 174 175 resources.getString("about.dialog.text.javaVersion") 176 177 + " : " 178 179 + System.getProperty("java.version"), SwingConstants.LEADING); 180 181 java.setForeground(Color.black); 182 183 info.add(java); 184 185 186 187 JLabel vm = new JLabel ( 188 189 resources.getString("about.dialog.text.virtualMachine") 190 191 + " : " 192 193 + System.getProperty("java.vm.name") 194 195 + ", " 196 197 + System.getProperty("java.vm.version"), SwingConstants.LEADING); 198 199 vm.setForeground(Color.black); 200 201 info.add(vm); 202 203 204 205 JLabel laf = new JLabel ( 206 207 resources.getString("about.dialog.text.lookAndFeel") 208 209 + " : " 210 211 + UIManager.getLookAndFeel().getName(), SwingConstants.LEADING); 212 213 vm.setForeground(Color.black); 214 215 info.add(laf); 216 217 this.panel.add("South", info); 218 219 } 220 221 } 222 223 | Popular Tags |