Swing

Remove the Title Bar of a Frame
Previous Home Next

 

        
In this program we will learn how to remove the title bar of a frame or window in java. That means that the frame show on the screen without title bar.

 
setUndecorated(boolean):
it is the  method of the JFrame class that is used to set the frame decoration. It takes a boolean typed value either true or false. If you passes the true then the frame will going to  undecorated means the frame will not show the title bar and if you passes the false then the frame will show the title bar.


package r4r;
import javax.swing.*;
public class removetitlebar {
	public static void main(String[] args) {
		  JFrame frame = new JFrame("Removing the Title Bar of a Frame");
		  frame.setUndecorated(true);
		  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		  frame.setSize(400,400);
		  frame.setVisible(true);
		  }
}

Previous Home Next