Saturday, 3 September 2016

Make JFrame unmovable, unclosable, unminimizable, unresizable & unmaximizable in Java Swing

Suppose, you have to develop a application which requires desktop locking- means user can not use the system if you don't allow to use it. For such kind of application we require that (I assume that it is a swing application) the JFrame should not be closed, maximized, minimized or movable.

To do so, we require remove title bar along with close, maximize and minimize buttons (windows buttons), so that JFrame could not be closed, moved, maximized or minimized

setUndecorated(true);    //remove title bar

setResizable(false);      //make frame static

setType(javax.swing.JFrame.Type.UTILITY);     //Jframe will not show in task bar

setAlwaysOnTop(true);       //set always on top if we don't close it using any action


No comments:

Post a Comment

Change image source dynamically on hyperlink

 Changing image source dynamically using JQuery. Here in this example I have created there hyperlink and stored all images in the same folde...