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

Always stay on top (JFrame)  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm aware of Window.setAlwaysOnTop(true). And this does what it's meant to- it stays on top even when you click away. The problem is, I want to have it so that the close buttons and shadow of the window don't fade as if you've lost focus whenever you click away. How can I do this?
 
Rancher
Posts: 3042
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It fades because it no longer has focus and is unable to accepts events until you click back on it again.

This is proper behaviour and would be extremely confusing for the user to have two windows with selected title bars because both would look like they could accept events.
 
Stuart Geipel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I don't want both to be focused, I only want the one window to have focus, and have it not change to my my other window.

Could I create a listener that listens to the focus of the other window, so that whenever it receives focus it hands it back to the stay on top window?
 
Rob Camick
Rancher
Posts: 3042
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you want to use the following on the child window:

 
Stuart Geipel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Awesome! Thanks so much!
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
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!