JOptionPane border color

How can I change the border color of JOptionPane?

Here is a screenshot of the border I'm talking about:

enter image description here

This blue border is what I'm trying to get rid of.

I tried UIManager.put ("OptionPane.border", the new BorderFactory ...), but this changed the inner border, not the outermost one. I need to get rid of this blue border.

Any ideas?

-Mark

0
java swing border joptionpane
source share
2 answers

Read the JOptionPane API . It shows you how to create the JOption panel manually so that you have access to JDialog. When you have JDialog, you can remove the border in the same way as in the last question:

Unshared JDialog Border

+2
source share

I have research on this today, in the end I found that this code can help you!

 UIManager.put("RootPane.frameBorder", new LineBorder(Color.red)); UIManager.put("RootPane.dialogBorder", new LineBorder(Color.red)); UIManager.put("RootPane.errorDialogBorder", new LineBorder(Color.red)); 
0
source share

All Articles