I've created a JFrame
with a JPanel
on it, that gets visible/invisible by clicking on an item in a list. I want to have a TitledBorder
(that's also the class name) go around it.
I already tried a few methods (setVisible
, setBorderPainted
) but none of them apply for the class. Also I can't find a suitable method in the Java doc!
My goal is to have the border invisible when the panel is, and visible when the panel is. All kind of solutions would help.
To display a titleBorder in the jPanel is done as follows:
yourPanel.setBorder(BorderFactory.createTitledBorder("your title"));
And to hide it would be:
yourPanel.setBorder(null);
I hope I've helped. ;)