mikera
mikera

Reputation: 106401

Custom Swing look and feel vs. custom components?

I'm writing a game using Swing and want to achieve a distinctive "steampunk" inspired look for the GUI. This will require some animated components, chunky metallic borders etc.

I know that I can get nice effects by overriding paintComponent and doing all of my rendering for custom lightweight components in that method.

Is this the way to go, or should I be looking at developing a whole new pluggable Look and Feel?

What are the pros/cons of each?

Upvotes: 3

Views: 2082

Answers (2)

Ishtar
Ishtar

Reputation: 11662

Creating a new L&F is a longer road, but keeps your code simple. (If you only need a few changes it's not worth the effort.) For example, the animations can be coded in the L&F part, so you don't need to worry about it in your components. I would suggest to edit a L&F that is close to what you need.

Upvotes: 3

Powerlord
Powerlord

Reputation: 88836

Personally, I think you should go for a completely new look and feel... you may also be able to build it off of Synth L&F rather than writing everything on your own.

Nimbus is an example of an L&F written on top of Synth.

Upvotes: 4

Related Questions