KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > AdminClientInfoPanel


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin;
5
6 import org.dijon.ContainerResource;
7 import org.dijon.Label;
8
9 import com.tc.admin.common.XContainer;
10 import com.tc.admin.common.XTextArea;
11
12 /**
13  * This is shown in the AboutDialog.
14  */

15
16 public class AdminClientInfoPanel extends XContainer {
17   private XTextArea m_systemInformationTextArea;
18   private Label m_copyrightLabel;
19
20   public void load(ContainerResource containerRes) {
21     super.load(containerRes);
22
23     m_systemInformationTextArea = (XTextArea)findComponent("SystemInformationTextArea");
24     m_copyrightLabel = (Label)findComponent("CopyrightLabel");
25   }
26   
27   public void init(String JavaDoc title, ProductInfo productInfo) {
28     String JavaDoc version = productInfo.getVersion();
29     String JavaDoc newLine = System.getProperty("line.separator");
30     String JavaDoc osInfo = System.getProperty("os.name") + " (" +
31                      System.getProperty("os.version") + "/" +
32                      System.getProperty("os.arch") + ")";
33     String JavaDoc javaVersion = "Java " + System.getProperty("java.version") + ", " +
34                                    System.getProperty("java.vendor");
35     String JavaDoc javaHomeDir = System.getProperty("java.home");
36     String JavaDoc javaVMInfo = System.getProperty("java.vm.name") + ", " +
37                          System.getProperty("java.vm.version") + " [" +
38                          Runtime.getRuntime().maxMemory()/(1024*1024) + " MB]";
39
40     m_systemInformationTextArea.setText(
41       title + " " + version + newLine +
42       osInfo + newLine +
43       javaVersion + newLine +
44       javaHomeDir + newLine +
45       javaVMInfo);
46
47     m_copyrightLabel.setText(productInfo.getCopyright());
48   }
49 }
50
Popular Tags