0

I want to create an overlay image in Java which floats above the desktop but does not have any mouse interaction.

(similar to Ignore mouse interaction on overlay image but in Java not Javascript)

I have already tried to make a Jframe with an transparent background. As seen in this photo:

enter image description here

This works well and I can click in the transparent area through to the desktop below. However, when I click on the image it still focuses the frame and has mouse interaction.

I have tried this stopping it from focusing:

window.setFocusableWindowState(false);
window.setFocusable(false);

I have also considered removing the mouse listeners but I don't know how to do that or if it would solve the issue.

My overall goal is to make this image float above the desktop but not stop clicking or interaction with the objects below.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
FatFrank
  • 73
  • 1
  • 10
  • You would have resend mouse event on low WINAPI level i think or maybe hook into message system and ignore message sent from OS to App so OS will think that this is not the target for event handling. – Antoniossss Aug 05 '19 at 09:56
  • @Antoniossss Is there no way to use `GlassPane` methods or other type to make the jframe invisible to mouse events? – FatFrank Aug 05 '19 at 09:57
  • For example, all transparent parts of the JFrame are ignored. I now want all visible parts of the frame to also be ignored. – FatFrank Aug 05 '19 at 09:59

0 Answers0