Reputation: 11
I am creating a look and feel that inherits from NimbusLookAndFeel
and let me know how I can register my own components to use their custom Painter.
For example, a JButton
like this ButtonPainter
class used to be painted. Also would like to know how to register different states (for examples BACKGROUND_ENABLED
, BACKGROUND_FOCUSED
...)
Can you lead me how I can do this? Actually I want to do is a custom tabbed pane and that this use their own Painter.
Edit: hmm I think I have not explained well.
I want to make a custom component, for example MyCustomTabbedPane
, and this stylize from the look and feel that inherits from Nimbus. Can I register my own UI classes, for example MyCustomTabbedPaneUI
making uiDefault.put("MyCustomTabbedPaneUI", new MyCustomTabbedPaneUI())
?
How I can make my own UI class what logic should have this class?
And another question, how I to assign this class Painter, for example MyCustomTabbedPanePainter
defining my own component states, as does Nimbus, such as BACKGROUND_ENABLED
.
Thanks and Regards!
Upvotes: 1
Views: 1535
Reputation: 109815
preferred of ways, there are a few Look and Feels based on Nimbus
another option, there are a few custom workaround for customize Nimbus Look and Feel
, one of most complex is NimbusThemeCreator by @aephyr (imports for Java6???)
hardiest of ways, have to create own xml file (see point 2nd.)
and to override all keys for UIManager
, everything on one place is UIManager Defaults by @camickr
easiest of ways is to override only Primary Colors & Secondary Colors, then Colors
are applied & valid for most of JComponents
Renderers
and Highlighter
are separete issue, have to decide if by using standard or override this Keys too, for example XxxRenderer
is preferred, in the case you override Nimbus UIDefaults
and Renderer
for concrete JComponent
, then Colors
are taken from Renderer
not from UIDefaults
Upvotes: 3