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); } }*/ } }
void canvasFocusLost(FocusEvent e) { if (isXEmbedActive() && !e.isTemporary()) { xembedLog.fine("Forwarding FOCUS_LOST"); int num = 0; if (AccessController.doPrivileged(new GetBooleanAction("sun.awt.xembed.testing"))) { Component opp = e.getOppositeComponent(); try { num = Integer.parseInt(opp.getName()); } catch (NumberFormatException nfe) { } } xembed.sendMessage(xembed.handle, XEMBED_FOCUS_OUT, num, 0, 0); } }
public void focusLost(FocusEvent e) { Component c = e.getComponent(); if (c instanceof TextField) ((TextField) c).select(0, 0); }
public void focusGained(FocusEvent e) { Component c = e.getComponent(); if (c instanceof TextField) ((TextField) c).selectAll(); }
public void focusGained(FocusEvent e) { fieldWithFocus = e.getSource(); if (fieldWithFocus == widthField) constainAspectRatio = true; else if (fieldWithFocus == yField) constainAspectRatio = false; }