public void focusLost(FocusEvent e) { Object objFocus = e.getSource(); boolean bSaveCmd = false; if (objFocus instanceof DataField) { DataField compFocus = (DataField) objFocus; Component comp = e.getOppositeComponent(); if (comp instanceof JButton) { String strTxt = ((JButton) comp).getText(); if (strTxt != null && strTxt.equals(WGlobal.SAVEUSER)) bSaveCmd = true; } // if the focus is not in the panel then write the file. /*if ((comp == null || !m_pnlDisplay.equals(comp.getParent())) && !bSaveCmd) { String strPrevValue = compFocus.getValue(); String strTxt = compFocus.getText(); if (!strPrevValue.equals(strTxt)) { // save the data by writing it to the file AppIF appIf = Util.getAppIF(); if (appIf instanceof VAdminIF) ((VAdminIF)appIf).getUserToolBar().doSave(); compFocus.setValue(strTxt); } }*/ } }
public void focusGained(FocusEvent e) { fieldWithFocus = e.getSource(); if (fieldWithFocus == widthField) constainAspectRatio = true; else if (fieldWithFocus == yField) constainAspectRatio = false; }