根据这篇文章的一些想法,我试图改变我的 JFileChooser 的颜色:
在 JFileChooser 中更改 WindowsPlacesBar 的颜色
但是我无法这样做,我找不到缺少哪个代码。到目前为止,我只得到了这个:
UIManager.put("Panel.background", Color.BLACK);
UIManager.put("Button.background", Color.BLACK);
UIManager.put("ComboBox.background", Color.BLACK);
UIManager.put("ComboBox.foreground", Color.WHITE);
UIManager.put("TextField.background", Color.BLACK);
UIManager.put("TextField.foreground", Color.WHITE);
UIManager.put("ToolBar.background", Color.BLACK);
UIManager.put("Viewport.background", Color.BLACK);
UIManager.put("Viewport.foreground", Color.WHITE);
SwingUtilities.updateComponentTreeUI(this);