Undecorated JDialog border

Mark picture Mark · Jul 1, 2013 · Viewed 11.8k times · Source

I have a question regarding the border around an undecorated JDialog using the Metal L&F.

Look at this picture to see the border that is on this window:

enter image description here

I'm trying to figure out how to either get rid of or change the color of the blue border around the very outside of the JDialog. I looked at the UI defaults for the Look & Feel but I wasn't able to come up with any that worked for this.

Does anybody have any ideas on how to get rid of that border?

Thanks!

Answer

camickr picture camickr · Jul 2, 2013

You need to change the Border of the root pane:

getRootPane().
   setBorder( BorderFactory.createLineBorder(Color.RED) );