2

I've got a Problem: In my Java application I've got an AWT Component (cannot change that one) that streams and shows an avi-file. Now I want to draw upon this movie and thought about putting a transparent JPanel above it and draw on that one.

This does not work since I either see the avi-stream or the drawn lines but not both.

I read somewhere that AWT does not support transparency of components - but the panel is a JPanel which is able to do so.

Can someone please help me with this one - thanks in advance.

4

4 回答 4

2

混合轻量级和重量级组件一文解释了仅在最新版本的 JDK 中如何处理此问题。

于 2010-02-17T16:49:03.730 回答
1

did you try a GlassPane since i think thats exactly it's use case. soemthing like JFrame.setGlassPane() if i remember correctly. check here:

Java API JFrame

GlassPane examples

于 2010-02-17T16:38:28.680 回答
0

尝试在单独的线程上运行 Stream 和 Drawing。我认为这会有所帮助

于 2013-03-28T10:48:50.713 回答
0

我已经搜索了一个可以帮助我的重量级组件,但我没有找到,而且关于内部框架,我不知道你是如何设法将不透明度设置为 50。我发现关于设置不透明度的所有内容都是 setOpaque 方法(布尔值),这对我一点帮助都没有。请你解释一下你是如何设置不透明度的。这是我最后的选择,否则我将不得不改变我的整个项目设计。

于 2010-03-21T14:06:45.833 回答