tags:

views:

425

answers:

3

In my application, I show a Jframe at the corner of screen for notification. And I want to show only Jframe and do not display a title bar at task bar.

How can I do that?

+1  A: 

You could try using a JWindow instead.

lins314159
A: 

Try adding a call to setUndecorated(true);. It tells the window manager to not add the title bar and window buttons.

Note: this must be called while the frame is not displayed.

Devon_C_Miller
Unfortunately, undecorated `JFrame` windows still appear in the taskbar, at least on the system that I'm testing on right now (Windows 7).
Joe Carnahan
Ah, missed that on the first read. Then you want to look at using a non-modal `JDialog`. It will behave the same, but will not have the minimize/maximize buttons on the titlebar as minimize without a taskbar presence makes no sense. Now, if you're trying to do a notification popup where it has no titlebar, no border, and no taskbar presence, you may want to look at JWindow.
Devon_C_Miller
+3  A: 

If you want the window to just appear and have neither a title bar nor appear in the taskbar, use a JWindow.

If you want the window to appear and have a title bar but to not appear in the taskbar, use a JDialog.

Joe Carnahan
This is correct. JFrame is meant to be the primary application window (ie, a framed window). JWindow is any popup window. JDialog is framed, but its a secondary window, so it doesn't show up in the taskbar.
Milan Ramaiya