Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make a window in Java using swing that has a border but not a title bar?

Tags:

java

swing

This is the result I'm after:

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

If it's not possible, that's all I need to hear. If it is possible, I would appreciate an explanation of how to make it happen. I am going to have a menu bar so people can close the window with that.

like image 677
JereTheJuggler Avatar asked Dec 24 '22 11:12

JereTheJuggler


1 Answers

You can use an undecorated JFrame. Then you just add a Border to the JRootPane of the frame:

JFrame frame = new JFrame(...);
frame.setUndecorated( true );
frame.getRootPane().setBorder( new MatteBorder(4, 4, 4, 4, Color.BLUE) );
like image 99
camickr Avatar answered Mar 01 '23 22:03

camickr