Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How to remove Frame/Window Title Bar

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can we remove the title bar of a frame. I want to create a stanalone window application without a title bar. I have tried a lot but of no avail.
Please gimme a direction. Rest i shall try.
 
Neeraj Singhal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey!!! everybody out here....
Please help me out. i'm in a fix.
Just gimme a direction. I shall do the rest.
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Neeraj,
How to remove a frame's title bar is something i don't know. & I feel this is not possible.

but Window by default does not have any border or title bar so u can use Window whenever u need no title bar.

I'm attaching a small code to show this
-----------------------------------------
import java.awt.*;
class NoTitleWindow extends Window
{
NoTitleWindow(Frame fr)
{
super(fr);
setBackground(Color.green);
add(new Label("Center"));
}
public static void main(String h[])
{
NoTitleWindow fr = new NoTitleWindow(new Frame ());
fr.setSize(200,200);
fr.setVisible(true);

}
}
-----------------------------------------
If u get to know how title bar can be removed from frame pls. post the method.
regards
deekasha
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can try using a JWindow which is a top level window without the title bar,nor any window management buttons.It has a constructor which allows u to create a window without any specified owner.But u will have to provide some user interface for window management and handle those events.
------------------
Come on in !! Drinks are on the house in the Big Moose Saloon !!
 
Neeraj Singhal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx a lot Deekasha for showing me the way.
The sample code u had given, have given me the much desired and awaited way for creating an application having no title bar.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic