Ability to click through a java app

后端 未结 3 449
暖寄归人
暖寄归人 2021-01-03 08:08

I\'ve got a simple program which atm displays a transparant window with an image on it, which is always on top of other windows. Is it possible to direct input past my app s

3条回答
  •  梦谈多话
    2021-01-03 08:49

    Using JNA's WindowUtils accomplishes this effect on Windows 7 (other systems untested):

    JFrame frame = new JFrame();
    //...
    frame.setAlwaysOnTop(true);
    System.setProperty("sun.java2d.noddraw", "true");
    WindowUtils.setWindowTransparent(frame, true);
    WindowUtils.setWindowAlpha(frame, 0.6f);
    

    Thanks to Nate's comment about setAlwaysOnTop for making this a more viable option.

提交回复
热议问题