Home Java Example Java Awt Removing the title bar of the Frame in Java
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Removing the title bar of the Frame in Java

Advertisement
In this section, you will learn about how to remove the titile bar of the frame in java.

Removing the title bar of the Frame in Java

     

Introducion

Here, you will learn how to display the frame or window without title bar in java. This type of the frame is mostly used to show the splash screen at starting of the application.

In this program, you can see that the method setUndecorated() has been used to hide the title bar of the frame or window. The frame is initially by default decorated. If you pass the boolean value true to the setUndecorated() method of the Frame class then the frame will look without the title bar otherwise the frame will be in the default format. The method setUndecorated() takes a boolean valued argument either true or false.

Here is the code of the program :

import java.awt.*;
import java.awt.event.*;

public class AwtWithoutTitleFrame{
public static void main(String[] args){
Frame frame = new Frame("Without Title Bar Frame");
Label lbl = 
new Label("Welcome in Roseindia.net Tutorial.",Label.CENTER);
frame.setUndecorated(true);
frame.add(lbl);
frame.setSize(400,400);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
Frame frame = (Frame)we.getSource();
frame.dispose();
  }
  });
  }
}

Download this example.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 17, 2007

Related Tutorials

Ask Questions?    Discuss: Removing the title bar of the Frame in Java   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Joseph
April 20, 2011
Removal of java bar

How to remove the java from any application of Samsung s5620?
Joseph
April 20, 2011
Removal of java bar

How to remove the java from any application of Samsung s5620?
affiar akhyar
October 9, 2011
the code

nicw....thanks lot bro....:)
prakash
June 11, 2012
java

addActionListener(this); why this method is using
bangke tong zampha
November 17, 2012
cc

thank's....
DMCA.com