What I would like in Java is to create a transparent screen over the entire screen that does not respond to events such as mouse or keyboard. Essentially, the user won't even know about the screen. How would I make the window "transparent" to events?
Asked
Active
Viewed 32 times
0
-
you mean you want the entire application to be full screen and invisible? – Constantin Jul 18 '15 at 19:36
-
Yes. Essentially, I want a window that exists but does not do anything. It also allows events to go through it. – hyper-neutrino Jul 19 '15 at 01:22
1 Answers
0
Read the section from the Swing tutorial on Creating a Translucent Window.
You would use an opacity of 0.0f.
Edit:
With an opacity of 0.0f the events go through the frame to the component below, therefore the window you click on will come to the front.
With a non-zero opacity (ie 0.05f) the events are intercepted by the frame.
You may also need to use:
frame.setAlwaysOnTop( true );
to prevent the window from coming to the front.
Play with the opacity and always on top property to get your desired effect. If these two properties don't work then I have no ideas to do what you are asking, nor do I understand the requirement.

camickr
- 321,443
- 19
- 166
- 288
-
Yes, but when I click, the event causes the window behind to come front, and I want the transparent frame to stay in front. – hyper-neutrino Jul 19 '15 at 01:28
-
@JamesSmith, in your original question you stated: `It also allows events to go through it.` - which is why I suggested an opacity of 0.0f. See edit. – camickr Jul 19 '15 at 02:54