Make a JPanel border with title like in Firefox

后端 未结 1 565
故里飘歌
故里飘歌 2021-01-18 03:15

I would like to make an option dialog in my application. In this dialog I want to make kind of Areas surrounded with a border and with a title.

An example of wha

相关标签:
1条回答
  • 2021-01-18 03:48

    Here you can find all informations you need.

    Basically you can use border factory to create a Border using types available in Swing:

    Border lineBorder = BorderFactory.createLineBorder(Color.black);
    JPanel panel = new JPanel();
    panel.setBorder(lineBorder);
    

    You can also define your custom borders implementing Border interface.

    0 讨论(0)
提交回复
热议问题