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:

http://img411.imageshack.us/img411/6866/image431.png

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.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Andy Smith
  • 3,308
  • 4
  • 26
  • 34

2 Answers2

2

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.

Eugene Ryzhikov
  • 17,131
  • 3
  • 38
  • 60
1

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

Jonas
  • 121,568
  • 97
  • 310
  • 388