-
May 31st, 2010, 01:28 PM
#1
Transarent background over heavyweight components
I've got a problem. In LayeredPane I have 2 components: heavyweight coponent and JComponent(or any other what I could draw text in) that is placed above the first one. I'd like JComponent to have transparent background, but it has black background. Heavyweight coponent is a component that renders video and JComponent is component what I draw text in. This text should be printed with transparent background.
I tried to use GlassPane but glass content of glassPane was displayed above lightweight components and below heavyweight component.
Is there possibility to draw text above heavyweight coponent (Canvas)?
ps. I can't overload paint method because I got object of class HeavyComponent that is subclass of Canvas.
-
June 1st, 2010, 02:35 PM
#2
Re: Transarent background over heavyweight components
There are issues with mixing heavyweight and lightweight components, particularly with regard to the Z order - see this article. Basically heavyweight components always draw on top of lightweight components in the same container.
Also heavyweight components are always opaque so you can't put a canvas above the video as it will obscure it.
ps. I can't overload paint method because I got object of class HeavyComponent that is subclass of Canvas.
You don't need to overload the paint method you need to override it and why does the fact that it is a subclass of Canvas matter?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|