This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
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.
 
Bartender
Posts: 9559
12
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: 9559
12
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: 9559
12
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.
 
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!