Unlimited JDialog Border

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

Look at this image to see the border that is in this window:

enter image description here

I am trying to figure out how to either get rid of or change the color of the blue border around JDialog itself. I looked at the user interface settings for Look and Feel, but I could not come up with everything that worked for this.

Anyone have any ideas on how to get rid of this border?

Thanks!

+7
java swing border jdialog uimanager
source share
3 answers

You need to change the root panel Border :

 getRootPane(). setBorder( BorderFactory.createLineBorder(Color.RED) ); 
+10
source share

You can do something like this:

 ((JPanel)getContentPane()).setBorder(BorderFactory.createLineBorder(Color.BLUE)); 

enter image description here


You can try to do this to change the outermost border:

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

Is that what you want to do?

+3
source share

If you want to get rid of it, you can use

 frame.setUndecorated(true); frame.getRootPane().setWindowDecorationStyle(JRootPane.NONE); 

To change the look of it from a Java style to a Windows style, you can use

 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
+3
source share

All Articles