You can use a JWindow instead of a JFrame... there is no title bar, so the user won't be able to move it.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Jun 16, 2004
Originally posted by Nathan Pruett: You can use a JWindow instead of a JFrame... there is no title bar, so the user won't be able to move it.
Thanks Sir, 4 replying me, but your solution is not sufficient, i want a window having title bar that why i choose jframe, in that window i don't frame is not resizable not closeable throght close button and not movable for that i use this
JFrame's are meant to be moved. That's what the title bar, in part, is for. If you don't want it to be dragged there is a few things you can do. None of which you are going to be satisfied with but I will tell you anway.
Do what Nathan said and create your own psuedo title bar using a custom JPa nel.
Use a window listener to determine when the frame is being dragged and apply a setBounds or setLocation giving it the inital X and Y values so it pops back into place
Maximize your app on the screen so the user can't drag it.