/** Overridden to add a listener to the editor if necessary, since the * UI won't do that for us without a focus listener */ public void addNotify() { super.addNotify(); if (isEditable() && getClass() == ComboInplaceEditor.class) { getEditor().getEditorComponent().addFocusListener(this); } getLayout().layoutContainer(this); }
private void prepareEditor() { Component c = getEditor().getEditorComponent(); if (c instanceof JTextComponent) { JTextComponent jtc = (JTextComponent) c; String s = jtc.getText(); if (s != null && s.length() > 0){ jtc.setSelectionStart(0); jtc.setSelectionEnd(s.length()); } if (tableUI) { jtc.setBackground(getBackground()); } else { jtc.setBackground(PropUtils.getTextFieldBackground()); } } if (getLayout() != null) { getLayout().layoutContainer(this); } repaint(); }
/** Overridden to add a listener to the editor if necessary, since the * UI won't do that for us without a focus listener */ @Override public void addNotify() { super.addNotify(); if (isEditable() && (getClass() == ComboInplaceEditor.class)) { getEditor().getEditorComponent().addFocusListener(this); } getLayout().layoutContainer(this); }
/** Overridden to add a listener to the editor if necessary, since the * UI won't do that for us without a focus listener */ public void addNotify() { super.addNotify(); if (isEditable() && getClass() == ComboInplaceEditor.class) { getEditor().getEditorComponent().addFocusListener(this); } getLayout().layoutContainer(this); }
private void prepareEditor() { Component c = getEditor().getEditorComponent(); if (c instanceof JTextComponent) { JTextComponent jtc = (JTextComponent) c; String s = jtc.getText(); if (s != null && s.length() > 0){ jtc.setSelectionStart(0); jtc.setSelectionEnd(s.length()); } if (tableUI) { jtc.setBackground(getBackground()); } else { jtc.setBackground(PropUtils.getTextFieldBackground()); } } if (getLayout() != null) { getLayout().layoutContainer(this); } repaint(); }
private void prepareEditor() { Component c = getEditor().getEditorComponent(); if (c instanceof JTextComponent) { JTextComponent jtc = (JTextComponent) c; String s = jtc.getText(); if ((s != null) && (s.length() > 0)) { jtc.setSelectionStart(0); jtc.setSelectionEnd(s.length()); } if (tableUI) { jtc.setBackground(getBackground()); } else { jtc.setBackground(PropUtils.getTextFieldBackground()); } if( tableUI ) jtc.requestFocus(); } if (getLayout() != null) { getLayout().layoutContainer(this); } repaint(); }