Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Removing the Title Bar of a Frame 
 

In this section, you will learn how to remove the title bar of a frame or window in java.

 

Removing the Title Bar of a Frame

                         

In this section, you will learn how to remove the title bar of a frame or window in java. That means show the frame or window without title bar. The title bar of the frame or window which holds the icon, minimize button, maximize button and close button with the title of the frame. Following  is the image of the frame without title bar:

Frame Without Title Bar

Code Description:

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

Here is the code of the program:

import javax.swing.*;

public class RemoveTitleFrame{
  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);
  }
}

Download this example.

                         

» View all related tutorials
Related Tags: c ide class methods method get icon height vi width change using int id ai create js define show paint

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

6 comments so far (
post your own) View All Comments Latest 10 Comments:

Very good application not know how it was looking ... thanks ..

--

Java is everything.

Posted by percy on Saturday, 03.8.08 @ 21:14pm | #52036

i have used the setundecorated() as u said but the problem is iam unable to position the frame when loaded please help

Posted by kareem on Friday, 02.1.08 @ 16:05pm | #46852

frame.setUndecorated(true); must be called before any call to setVisible or pack();

Try moving frame.setUndecorated(true); to the spot right after the creation of the frame.

Posted by RandomAnon on Thursday, 09.20.07 @ 20:59pm | #28207

on using frame.setUndecorated(true);
i am getting this exception
java.awt.IllegalComponentStateException

Posted by Amarnath Anna on Thursday, 08.9.07 @ 21:09pm | #23041

on using frame.setUndecorated(true);
i am getting this exception
java.awt.IllegalComponentStateException

Posted by Nirmal on Wednesday, 08.8.07 @ 15:42pm | #22934

It is good ...It is very helpful to me...
I am waiting for this code..from last 2 days

Posted by Venkateswara Rao on Tuesday, 11.28.06 @ 11:38am | #170

Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.