I am using Nimbus L&F , JDK 1.7 and Netbeans 8.0.
I should customize Nimbus. However, when I run my project even without changing any code, some colors which I set by UIManager are changing.
This is where I set Nimbus;
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
System.err.println("Some error");
}
Here is my painter example (darkpainter is the same with Color.Gray instead of Color.orange);
Painter orangePainter = new Painter() {
@Override
public void paint(Graphics2D g, Object object, int width, int height) {
g.setColor(Color.Orange);
g.fillRect(0, 0, width, height);
}
};
And I am customizing with these codes;
UIManager.put("control", Color.gray);
UIManager.put("nimbusBlueGrey", Color.gray.darker());
UIManager.put("nimbusBorder", Color.orange);
UIManager.put("TabbedPane:TabbedPaneTab[Disabled].backgroundPainter", darkpainter);
UIManager.put("TabbedPane:TabbedPaneTab[Disabled+Selected].backgroundPainter", orangePainter);
UIManager.put("TabbedPane:TabbedPaneTab[Enabled].backgroundPainter", darkpainter);
UIManager.put("TabbedPane:TabbedPaneTab[Selected].backgroundPainter", orangePainter);
I couldn't find the problem. I tried to use JDK 1.8 and Netbeans 7.3. I also tried to run from console directly but the same problem. Thank you for your help.