Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
 
 
Search All Tutorials
  

 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
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. 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.

                         

Facing Programming Problem?
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

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.

Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

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

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

Copyright © 2008. All rights reserved.