aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Is there a way to make a window (no frame) and add my own components to it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Is there a way to make a window (no frame) and add my own components to it?" Watch "Is there a way to make a window (no frame) and add my own components to it?" New topic
Author

Is there a way to make a window (no frame) and add my own components to it?

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
I want to essentially make a frame but with my own title bar etc. Is there a way to do this? I tried extending awt.window, but to no avail. I want to have a window and then put components on it.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8902
    
    8

Originally posted by Robert Paris:
Is there a way to do this?

Both java.awt.Window and javax.swing.JWindow create windows without decorations. What's the problem?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
Sorry, i was unclear. I meant can i make the JWindow resizable and draggable? (And minimizable and show up in the task bar)
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8902
    
    8

I see two options. you can use the pluggable look+feel to set up the frame the way want, or you can use a Frame/JFrame and use setUndecorated() to remove the regular max/min/close buttons + title bar. setExtendedState() lets you programmatically max+min. Closing is easy enough. Dragging, well, look at java.awt.event.MouseListener.
Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
I'm using Java 1.3 and those methods don't exist in 1.3.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8902
    
    8

And it doesn't look like look+feel extends to the titlebar or decorations. Good case for upgrading the old JDK.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to make a window (no frame) and add my own components to it?