1 package org.jacorb.poa.gui.poa; 2 3 22 23 import java.awt.Label ; 24 25 29 public class StatePanel extends java.awt.Panel { 30 private java.awt.Label ivjNameLabel = null; 31 private java.awt.Label ivjValueLabel = null; 32 36 37 private java.awt.Label getNameLabel() { 38 if (ivjNameLabel == null) { 39 try { 40 ivjNameLabel = new java.awt.Label (); 41 ivjNameLabel.setName("NameLabel"); 42 ivjNameLabel.setText("State:"); 43 ivjNameLabel.setBounds(10, 10, 50, 23); 44 ivjNameLabel.setForeground(java.awt.Color.black); 45 } catch (java.lang.Throwable ivjExc) { 48 handleException(ivjExc); 51 } 52 }; 53 return ivjNameLabel; 54 } 55 Label _getStateLabel() { 56 return getValueLabel(); 57 } 58 62 63 private java.awt.Label getValueLabel() { 64 if (ivjValueLabel == null) { 65 try { 66 ivjValueLabel = new java.awt.Label (); 67 ivjValueLabel.setName("ValueLabel"); 68 ivjValueLabel.setFont(new java.awt.Font ("dialog", 2, 12)); 69 ivjValueLabel.setText("active"); 70 ivjValueLabel.setBounds(60, 10, 230, 23); 71 } catch (java.lang.Throwable ivjExc) { 74 handleException(ivjExc); 77 } 78 }; 79 return ivjValueLabel; 80 } 81 85 private void handleException(Throwable exception) { 86 87 88 } 91 94 95 private void initialize() { 96 setName("StatePanel"); 99 setLayout(null); 100 setBackground(java.awt.SystemColor.control); 101 setSize(300, 43); 102 add(getNameLabel(), getNameLabel().getName()); 103 add(getValueLabel(), getValueLabel().getName()); 104 } 107 111 public StatePanel(java.awt.LayoutManager layout) { 112 super(layout); 113 } 114 118 public static void main(java.lang.String [] args) { 119 try { 120 java.awt.Frame frame; 121 try { 122 Class aFrameClass = Class.forName("com.ibm.uvm.abt.edit.TestFrame"); 123 frame = (java.awt.Frame )aFrameClass.newInstance(); 124 } catch (java.lang.Throwable ivjExc) { 125 frame = new java.awt.Frame (); 126 } 127 StatePanel aStatePanel; 128 aStatePanel = new StatePanel(); 129 frame.add("Center", aStatePanel); 130 frame.setSize(aStatePanel.getSize()); 131 frame.setVisible(true); 132 } catch (Throwable exception) { 133 System.err.println("Exception occurred in main() of java.awt.Panel"); 134 exception.printStackTrace(System.out); 135 } 136 } 137 public void paint(java.awt.Graphics g) { 138 g.setColor(getBackground()); 139 g.fill3DRect(0, 0, getBounds().width, getBounds().height, true); 140 } 141 144 145 public StatePanel() { 146 super(); 147 initialize(); 148 } 149 } 150 151 152 153 154 155 156 157 158 159 160 161 162 | Popular Tags |