Is it possible to make a window in Java using swing, which has a border but no title bar?

This is the result that I get after:

http://i.stack.imgur.com/LeCwF.png

If this is not possible, then all I need to hear. If possible, I would appreciate an explanation of how this happened. I will have a menu bar so people can close the window with this.

+4
source share
1 answer

You can use unecorated JFrame. Then you just add Borderto the JRootPaneframes:

JFrame frame = new JFrame(...);
frame.setUndecorated( true );
frame.getRootPane().setBorder( new MatteBorder(4, 4, 4, 4, Color.BLUE) );
+10
source

Source: https://habr.com/ru/post/1622272/


All Articles