• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to remove Frame/Window Title Bar

 
Neeraj Singhal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • 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
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!