/* WARNING: THIS METHOD WILL BE REGENERATED. */ private java.awt.Label getLabel1() { if (ivjLabel1 == null) { try { ivjLabel1 = new java.awt.Label(); ivjLabel1.setName("Label1"); ivjLabel1.setFont(new java.awt.Font("serif", 3, 24)); ivjLabel1.setAlignment(java.awt.Label.CENTER); ivjLabel1.setText("Name not found!"); ivjLabel1.setForeground(java.awt.Color.red); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjLabel1; }
/* WARNING: THIS METHOD WILL BE REGENERATED. */ private java.awt.Label getLabel121() { if (ivjLabel121 == null) { try { ivjLabel121 = new java.awt.Label(); ivjLabel121.setName("Label121"); ivjLabel121.setAlignment(java.awt.Label.CENTER); ivjLabel121.setText("E.O. Stinson"); ivjLabel121.setBackground(java.awt.Color.white); ivjLabel121.setBounds(7, 23, 384, 23); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjLabel121; }
/* WARNING: THIS METHOD WILL BE REGENERATED. */ private java.awt.Label getLabel11() { if (ivjLabel11 == null) { try { ivjLabel11 = new java.awt.Label(); ivjLabel11.setName("Label11"); ivjLabel11.setAlignment(java.awt.Label.LEFT); ivjLabel11.setText("foo"); ivjLabel11.setBackground(java.awt.Color.white); ivjLabel11.setBounds(26, 45, 362, 18); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjLabel11; }
/* WARNING: THIS METHOD WILL BE REGENERATED. */ private java.awt.Label getLabel2() { if (ivjLabel2 == null) { try { ivjLabel2 = new java.awt.Label(); ivjLabel2.setName("Label2"); ivjLabel2.setLocation(10, 22); ivjLabel2.setText(""); ivjLabel2.setBackground(java.awt.SystemColor.control); ivjLabel2.setSize(70, 12); ivjLabel2.setForeground(java.awt.Color.black); ivjLabel2.setFont(new java.awt.Font("dialog", 2, 10)); ivjLabel2.setAlignment(1); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } ; return ivjLabel2; }
/** * 新增視窗物件 設定物件屬性 內容 * * @param o 物件instances * @param reg 物件位置 * @param name 物件名稱 * @param value 物件標籤 或 內容 */ protected void addObject(Object o, Rectangle reg, String name, String value) { if (o instanceof Label) { ((Label) o).setText(value); ((Label) o).setName(name); ((Label) o).setBounds(reg); ((Label) o).addMouseListener(this); this.add((Label) o); } else if (o instanceof TextField) { ((TextField) o).setText(value); ((TextField) o).setName(name); ((TextField) o).setBounds(reg); ((TextField) o).addMouseListener(this); ((TextField) o).addTextListener(this); ((TextField) o).addKeyListener(this); if (value.equalsIgnoreCase("password")) ((TextField) o).setEchoChar('*'); this.add((TextField) o); } else if (o instanceof Button) { int len = (int) ((float) reg.width / FONTWIDTH); ((Button) o).setLabel(StringUtil_.splitStringSpace(value, len)); ((Button) o).setName(name); ((Button) o).setBounds(reg); ((Button) o).addMouseListener(this); this.add((Button) o); } else if (o instanceof TextArea) { ((TextArea) o).setText(value); ((TextArea) o).setName(name); ((TextArea) o).setBounds(reg); ((TextArea) o).addMouseListener(this); ((TextArea) o).addTextListener(this); ((TextArea) o).addKeyListener(this); this.add((TextArea) o); } else if (o instanceof Choice) { String[] values = value.split(","); for (int ii = 0; ii < values.length; ii++) ((Choice) o).addItem(values[ii]); ((Choice) o).setName(name); ((Choice) o).setBounds(reg); ((Choice) o).addMouseListener(this); ((Choice) o).addItemListener(this); this.add((Choice) o); } else if (o instanceof Checkbox) { ((Checkbox) o).setLabel(value); ((Checkbox) o).setName(name); ((Checkbox) o).setBounds(reg); ((Checkbox) o).addMouseListener(this); ((Checkbox) o).addItemListener(this); this.add((Checkbox) o); } else if (o instanceof CheckboxGroup) { String[] values = value.split(","); for (int ii = 0; ii < values.length; ii++) { Checkbox chk = new Checkbox(); chk.setLabel(values[ii]); chk.setName(name + ii); chk.setBounds(reg); reg.y += 25; chk.addMouseListener(this); chk.addItemListener(this); chk.setCheckboxGroup((CheckboxGroup) o); this.add(chk); } } else if (o instanceof List) { String[] values = value.split(","); ((List) o).setName(name); ((List) o).setBounds(reg); ((List) o).addMouseListener(this); ((List) o).addItemListener(this); for (int ii = 0; ii < values.length; ii++) ((List) o).add(values[ii]); this.add(((List) o)); } }