List of usage examples for javax.swing JComboBox getComponents
public Component[] getComponents()
From source file:Main.java
public Main() { someComboBox.setFont(new Font("Serif", Font.BOLD, 16)); someComboBox.setEditable(true);/* w w w .ja v a2s. c o m*/ someComboBox.getEditor().getEditorComponent().setBackground(Color.YELLOW); ((JTextField) someComboBox.getEditor().getEditorComponent()).setBackground(Color.YELLOW); JTextField text = ((JTextField) editableComboBox.getEditor().getEditorComponent()); text.setBackground(Color.YELLOW); JComboBox coloredArrowsCombo = editableComboBox; Component[] comp = coloredArrowsCombo.getComponents(); for (int i = 0; i < comp.length; i++) { if (comp[i] instanceof MetalComboBoxButton) { MetalComboBoxButton coloredArrowsButton = (MetalComboBoxButton) comp[i]; coloredArrowsButton.setBackground(null); break; } } non_EditableComboBox.setFont(new Font("Serif", Font.BOLD, 16)); frame = new JFrame(); frame.setLayout(new GridLayout(0, 1, 10, 10)); frame.add(someComboBox); frame.add(editableComboBox); frame.add(non_EditableComboBox); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocation(100, 100); frame.pack(); frame.setVisible(true); }