7

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 what I want is in Firefox:

Firefox Options

How can I do something like that in Java?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Neifen
  • 2,546
  • 3
  • 19
  • 31

1 Answers1

11

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.

Heisenbug
  • 38,762
  • 28
  • 132
  • 190