my jdk version is : 1.6.0_33
Fixes tried :
UIManager.getLookAndFeelDefaults().put("TextPane.background", Color.RED);
but this also is unable to override the Nimbus default which is #d6d9df (214,217,223)
Can anyone help me with text Centering in the JTextArea?
Thanks in advance
1. JTextArea
-------supports: Text Wrapping + background coloring with Nimbus LnF (only when its enabled)
-------issue : Text Centering is an issue in here
To center text you should use a JTextPane not a JTextArea. Centering text is a big issue.
It is better to solve the background problem with the JTextPane.
When using the Nimbus LAF it looks like you need to provide a custom Painter to just paint the background as a solid color. Check out this answer by @mKorbel. You would need to change the property tag. Also in the FillPainter I changed:
g.setColor(color);
g.setColor(object.getBackground());