Hello all,

can anyone tell me how to make a JFrame fixed, by not allowing user to drag it somewhere else in the window? like doking the JFrame in the screen, also disallow user to resize it.


I think there is nothing such as absolute position of frame. However you can disable resizing by using inherited method setResizable of Frame

Could you have a Window listener that uses setLocation to move it back.


you can do it via this..

@amit.hak50 you better read original question and not to take very first google result that pop-ups on you. Otherwise you wouldn't suggest method that deals with layout instead of positioning...


public void setUndecorated(boolean undecorated)

Disables or enables decorations for this frame. This method can only be called while the frame is not displayable.

I understand the question ..


you can't able to resize it and can able to move it ..i thin now you got it ...

and well ..i don't use google much ..it finishes your intelligency

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.