Hi to all programmers out there! :D
I want to create a JFrame
without borders and size buttons. For example like the frame of the Steam-program for PC. I searched and found JWindow
and the setUndecorated
method for JFrame
.
When I use one of these options I get a window without borders, but I can't resize it. Is there an easy way to keep this feature, especially the "snap-feature"? I mean Valve managed to solve this problem somehow :)
This question describes perfectly what I want, but there is only one answer and it's not very helpful...
Check out Resizing Components. It is a general purpose class that allows you to resize any component. It will provide the appropriate cursor as the mouse is around the edge of the frame.
Basic usage for a frame would be:
JFrame frame = new JFrame("SSCCE");
frame.setUndecorated( true );
ComponentResizer cr = new ComponentResizer();
cr.registerComponent(frame);
Of course you will need to make sure that the frame has blank border around the edges so the MouseEvents are passed to the frame and not the component added to the frame.