• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Java 1.3 and those methods don't exist in 1.3.
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And it doesn't look like look+feel extends to the titlebar or decorations. Good case for upgrading the old JDK.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic