JWindow transparent background in Java (no screenshots needed)

I saw other answers and cracked this question, but nobody seems to be doing what I need.

In fact, I am after JWindow, whose background is translucent, but the contents of the window itself (buttons, text, etc.) are opaque. The methods I've seen so far fall into one of two categories:

  • Taking pictures from behind the window and using them (http://onjava.com/pub/a/onjava/excerpt/swinghks_hack41/index.html) is not very good in this scenario, since it is too slow, I want to you could put things like video outside the window and show it through
  • Ensuring the transparency of the entire window (including components that I need to remain opaque on.)

This is what I ask, and if so, how to do it? If not, will Java 7 offer any methods to make this simpler / possible? I know that he got a lot of support built into molded windows, so I wonder if this can take care of this. I searched around for a while, but no luck.

+3
source share
1 answer

This can only be done if you are using the JDK 6 10 and above update. It is also necessary to support hardware acceleration. Cm

http://download.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html

+8
source

Source: https://habr.com/ru/post/1786813/


All Articles