/** Create a ComboBoxUI that does not display borders on the combo box. * Since the property sheet is rendered as a table, this looks better. * This UI also delegates closing of its popup to the property sheet, which * has better knowledge of when this is appropriate, in the case of focus * changes. Inplace editors which employ a combo box should use the UI * returned by this method, rather than the default for the look and feel. * Thus the appearance will be consistent with the rest of the property * sheet. */ public static javax.swing.plaf.ComboBoxUI createComboUI (JComboBox box, boolean tableUI) { return new CleanComboUI(tableUI); }
/** Create a ComboBoxUI that does not display borders on the combo box. * Since the property sheet is rendered as a table, this looks better. * This UI also delegates closing of its popup to the property sheet, which * has better knowledge of when this is appropriate, in the case of focus * changes. Inplace editors which employ a combo box should use the UI * returned by this method, rather than the default for the look and feel. * Thus the appearance will be consistent with the rest of the property * sheet. */ public static javax.swing.plaf.ComboBoxUI createComboUI(JComboBox box, boolean tableUI) { return new CleanComboUI(tableUI); }
/** Create a ComboBoxUI that does not display borders on the combo box. * Since the property sheet is rendered as a table, this looks better. * This UI also delegates closing of its popup to the property sheet, which * has better knowledge of when this is appropriate, in the case of focus * changes. Inplace editors which employ a combo box should use the UI * returned by this method, rather than the default for the look and feel. * Thus the appearance will be consistent with the rest of the property * sheet. */ public static javax.swing.plaf.ComboBoxUI createComboUI (JComboBox box, boolean tableUI) { return new CleanComboUI(tableUI); }
private void prepareCustomEditor( Object customEditorObj ) { JComboBox comboBox = null; if( customEditorObj instanceof DefaultCellEditor ) { if( ((DefaultCellEditor)customEditorObj).getComponent() instanceof JComboBox ) { comboBox = ( JComboBox ) ((DefaultCellEditor)customEditorObj).getComponent(); } } else if( customEditorObj instanceof JComboBox ) { comboBox = ( JComboBox ) customEditorObj; } if( null != comboBox ) { if( !(comboBox.getUI() instanceof CleanComboUI) ) { comboBox.setUI( new CleanComboUI( true ) ); ComboBoxAutoCompleteSupport.install( comboBox ); } } }