Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple Windows  RSS feed

 
Ben Jass
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question 1:

Let's say I have two windows (Picture 1)

How do I make the window on the backside, unclickable or uneditable?

Question 2:

Going one step further, if I wanted to blur out the window on the backside. How would I do this if the back window is made up of JComponents?
Picture-1.png
[Thumbnail for Picture-1.png]
 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a JDialog for the window in front. A JDialog is "modal", which means that it prevents other windows in the same application from responding.

Sorry, don't know the answer to your second question, although if it helps, you might notice that the answer to it wouldn't depend on the presence or absence of modal dialogs. It's just "How do I make a panel look blurred?"
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For blurring, you can use JLayer
Check out the working example at http://docs.oracle.com/javase/tutorial/uiswing/misc/jlayer.html
 
Fred Kleinschmidt
Bartender
Posts: 560
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Use a JDialog for the window in front. A JDialog is "modal", which means that it prevents other windows in the same application from responding.


A JDialog can be modal, but it is not necessary that it be.

 
Ben Jass
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys for your responses. Was able to use Jdialogs and you can adjust their modality in the constructor. I will look further into JLayer's, thank you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!