JPanel and TitledBorder UI properties with Nimbus
I would like to change the default Nimbus TitledBorder L&F, to a simple blue rounded titled border. The title should also be blue.
I could make it, but the problem is that i would like to apply it to specific panel and not all panels in my GUI, so UIManager.put("TitledBorder.titleColor", Color.blue)
is not applicable.
I could do it other way than with the L&F properties, but using L&F properties is less change in code if i have to change something.
How can i set to开发者_Python百科 only the wanted panel using L&F properties ?
Thank you for help.
Can you try the below code?
jPanel.setBorder(new TitledBorder(new LineBorder(Color.BLUE), "Sample title", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.CENTER, new Font("SansSerif", Font.PLAIN, 12), Color.BLUE))
精彩评论