Add transparent JPanel upon AWT Component to paint on
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.
The Mixing Light and Heavyweight Components article explains how this is handled only in the most recent version of the JDK.
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
I've searched for a heavyweightcomponent that could help me but I didn't found one, and regarding the internalframes I don't know how you managed to set the opacity to 50. All what I found about seetting the opacity wast the method setOpaque(boolean value) and this doesn't help me at all. Would you please explaine me how did you set that opacity. It's my final alternative either that or I'll have to change my entire project design.
Try running Stream and Drawing on separate thread. I think this can help
精彩评论