views:

76

answers:

2

I'm currently working on making my Swing application look better. I want to achieve something along these lines:

The idea is for each box to have a pretty header with a background similar to the above image. The closest I can get to anything like this using basic Swing components is adding a TitledBorder but this is nothing close to what I want.

I have experiment with JXTaskPane from SwingX, which is close:

And near perfect, except for the fact that it's collapsible and it doesn't appear possible to make it not collapsible.

Are there any obvious solutions I'm missing here? Otherwise I figure extending JPanel and creating a special header for it using a image for the background of the header.

Any pointers greatly appreciated. Thanks.

+1  A: 

Yes, why not write your own custom border or JPanel for that? You customize the painting by overriding the paintComponent-method.

Jonas
+1  A: 

Since you already looking into SwingX components, why don't you use JXTitledPanel? I think it is very close to what you want to achieve. You can set your own colors there.

eugener
How did i miss that? Thanks!
Andrew