• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame Greying Out  RSS feed

 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am using a JFrame and when a dialog box opens I would like all the frame's contents (buttons, icons, etc) to turn grey until the dialog box is closed. How would I accomplish this?

Regards.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you want them all disabled?

you can start at the top level container and recursively call container.getComponents(),
and disable them, but I'm trying to work out the purpose of this - if it is
to stop access to the components, all you'd have to do is set the dialog's
modal property to true
 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not looking for any functionality, I am looking to make a graphical enhancement.

I saw the concept in a web application and I would like to mimic that in my java application.

Is there a way to get the glass pane and apply a grey filter to it.

Thanks.
 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good example would be on Windows XP when you goto start --> Turn off computer.... The dialog pops up and the background fades to grey. If you cancel all the color comes back.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've not done this, but you'd probably be looking at setting a glasspane,
then setting the colors via paintComponent() and a timer.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!