Skip to main content

TitledBorder in Swing

No replies
Joined: 2010-10-10

Hello all,

I have a problem creating proper TitledBorder to JPopupMenu.

The result is a border that is very thick, and white, while in all the examples I found on the net the thickness is 1 - simple line.

The TitledBorder class in java sais that it uses the look&feel to determine the border, but I want it to be thickness 1.

How should I do it?


The code:

Class MenuPopup extends JPopupMenu{
LinedBorder border = new LinedBorder(Color.WHITE, 1);
//creates border with thickness 1.
border = new TitledBorder(border, "some title);
//The result is a border with thikcness 5 or more.