Search code examples
javaswingborderjoptionpanelook-and-feel

Color of JOptionPane border


How might I go about changing the color of a JOptionPane's border?

Here is a screenshot of the border I am talking about:

enter image description here

That blue border is what I am trying to get rid of.

I tried to set UIManager.put("OptionPane.border", new BorderFactory...)for LookAndFeel but that changed the inside border, not the outermost one.

I need to get rid of that blue border.

Any ideas?

-Mark


Solution

  • Read the JOptionPane API. It shows you how to create a JOption pane manually so that you have access to the JDialog. Once you have the JDialog you can remove the Border the same way you did in your last question:

    Undecorated JDialog border