我对来自Glazed Lists的组合框使用自动完成功能。这非常有用。我也使用nibus L& F.但它忽略了JCombobox.setBackground(Color)。有没有办法强制使用nimbus将backgroundcolor强制为红色?
Examplecode:
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
final JFrame frame = new JFrame();
JComboBox cbox = new JComboBox();
String[] strs = {"Nowarro", "Klamat", "Den", "NKR"};
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch (Throwable e1) {
e1.printStackTrace();
}
AutoCompleteSupport.install(cbox, GlazedLists.eventList(Arrays.asList(strs)));
cbox.setBackground(Color.RED); // NO EFFECT!!!
frame.getContentPane().add(cbox);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}