Take the 2-minute tour ×

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.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
How did i miss that? Thanks! –  Andy Smith Feb 23 '10 at 23:49

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

share|improve this answer

Your Answer


