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); }
protected void layoutUIComponents(String strPath, boolean bDefaultFile) { // gbc.weightx = 0.5; showInstructions(m_gbl, m_gbc, 0, 0, 7, infoLabel1); showInstructions(m_gbl, m_gbc, 0, 1, 7, infoLabel2); showInstructions(m_gbl, m_gbc, 0, 2, 7, infoLabel3); /*showInstructions( gbl, gbc, 0, 3, 7, infoLabel4 ); showInstructions( gbl, gbc, 0, 4, 7, infoLabel5 );*/ showInstructions(m_gbl, m_gbc, 0, 5, 1, new JLabel("")); // i18n // label = new JLabel( "LABEL" ); label = new JLabel(Util.getAdmLabel("_adm_LABEL")); label.setForeground(Color.black); m_gbc.gridx = 1; m_gbc.gridy = 5; // gbc.ipadx = 10; m_gbl.setConstraints(label, m_gbc); m_pnlDisplay.add(label); label = new JLabel(" "); m_gbc.gridx = 2; m_gbc.gridy = 5; m_gbc.ipadx = 0; m_gbc.gridwidth = 5; m_gbc.weightx = 0; m_gbl.setConstraints(label, m_gbc); // add( label ); // i18n // showInstructions( m_gbl, m_gbc, 2, 5, 1, new JLabel( "DIRECTORY" )); showInstructions(m_gbl, m_gbc, 2, 5, 1, new JLabel(Util.getAdmLabel("_adm_DIRECTORY"))); m_nRow = 5; m_bDefaultFile = bDefaultFile; m_objTxfValue.clearArrays(); displayNewTxf(strPath); m_pnlDisplay.setBorder( new CompoundBorder( // i18n // BorderFactory.createTitledBorder( " Parent Directories "), BorderFactory.createTitledBorder(Util.getAdmLabel("_adm_Parent_Directories")), BorderFactory.createEmptyBorder(10, 10, 10, 10))); }