Undecorated JDialog border

本秂侑毒 提交于 2019-12-04 05:13:20
camickr

You need to change the Border of the root pane:

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

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 the Java style to the windows style you can use

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

You can do something like this:

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


You can try to do this in order to change the most outsude border:

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

Is this what you want to do?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!