List of usage examples for javax.swing JComboBox setRequestFocusEnabled
public void setRequestFocusEnabled(boolean requestFocusEnabled)
JComponent
should get focus. From source file:com.aw.swing.mvp.binding.component.BndSJTable.java
private JComboBox getJComboBox(ComboBoxModel comboBoxModel) { final JComboBox jComboBox = new JComboBox(comboBoxModel); jComboBox.addFocusListener(new CellEditableFocusListener()); jComboBox.setRequestFocusEnabled(true); jComboBox.putClientProperty(CellEditorUtils.AW_CELL_EDITOR, Boolean.TRUE); jComboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE); jComboBox.addAncestorListener(new AncestorListener() { public void ancestorAdded(AncestorEvent event) { jComboBox.requestFocusInWindow(); }/*from ww w. j ava2 s. c o m*/ public void ancestorMoved(AncestorEvent event) { } public void ancestorRemoved(AncestorEvent event) { } }); return jComboBox; }