我一直在寻找如何在 JLabel 周围制作边框。但我不希望它没有颜色。提前致谢。
public TitlePanel()
{
title = new JLabel("This is some text!", JLabel.CENTER);
add(title);
//This will make a black border around the "title" label
title.setBorder(new LineBorder(new Color(0,0,0)));
}