views:

49

answers:

3

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?

+3  A: 

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.

R. Bemrose
Thanks! This has proved great advice: I managed to get a customised version of Synth working and rendering some shiny new components in a couple of hours.
mikera
+1 for Synth LAF, it's a great LAF (and would be even better if base Synth UI objects were public and not friendly... ahem). **@mikera** Just, if you consider a lot of changes and a heavily used application, it's better not to use xml configuration and painting by images, but to implement custom painters and configuration in the code (see Nimbus implementation in java7). Eats a lot less memory, and is more manageable.
Taisin
+2  A: 

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.

Ishtar
+1  A: 

See my answer to an almost identical question from a few weeks ago.

Kirill