protected void displayNewTxf(String strLabel, String strValue) { strLabel = (strLabel == null) ? "" : strLabel.trim(); strValue = (strValue == null) ? "" : strValue.trim(); JCheckBox chkBox1 = new JCheckBox(Util.getImageIcon("boxGray.gif")); DataField txf1 = new DataField(strLabel); DataField txf2 = new DataField(strValue); JPanel pnlTxf = new JPanel(m_gbl); m_nRow = m_nRow + 1; txf1.setName("label"); txf2.setName("value"); /* 1st line of text field*/ m_gbc.weightx = 0; showComp(m_gbl, m_gbc, 0, m_nRow, 1, chkBox1); m_gbc.weightx = 1; showComp(m_gbl, m_gbc, GridBagConstraints.RELATIVE, m_nRow, 1, txf1); // showSpaces( gbl, gbc, 2, 6 ); showComp(m_gbl, m_gbc, GridBagConstraints.RELATIVE, m_nRow, 1, txf2); m_gbc.weightx = 0; txf1.addFocusListener(this); txf2.addFocusListener(this); m_objTxfValue.addToLabel(txf1); m_objTxfValue.addToValue(txf2); }
protected void displayNewTxf(String strLabel, String strValue) { strLabel = (strLabel != null) ? strLabel.trim() : ""; strValue = (strValue != null) ? strValue.trim() : ""; JCheckBox chk1 = new JCheckBox(Util.getImageIcon("boxGray.gif")); final DataField txf1 = new DataField(strLabel); final DataField txf2 = new DataField(strValue); m_nRow = m_nRow + 1; txf1.setName("label"); txf2.setName("value"); // new field if (strLabel.equals("") && strValue.equals("")) { txf2.setText(INFOSTR); txf2.addMouseListener(m_mlTxf); if (timer != null) timer.cancel(); timer = new java.util.Timer(); timer.schedule( new TimerTask() { public void run() { WUtil.blink(txf2, WUtil.FOREGROUND); } }, delay, delay); } /* 1st line of text field*/ m_gbc.weightx = 0; showComp(m_gbl, m_gbc, 0, m_nRow, 1, chk1); m_gbc.weightx = 1; showComp(m_gbl, m_gbc, GridBagConstraints.RELATIVE, m_nRow, 1, txf1); // showSpaces( gbl, gbc, 2, 6 ); showComp(m_gbl, m_gbc, GridBagConstraints.RELATIVE, m_nRow, 1, txf2); m_gbc.weightx = 0; txf1.addFocusListener(this); txf2.addFocusListener(this); // Add the textfields to the respective arrays, so that they // can be retreived later for writing to the file. m_objTxfValue.addToLabel(txf1); m_objTxfValue.addToValue(txf2); }