wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes how to make Canvas transparent ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to make Canvas transparent ?" Watch "how to make Canvas transparent ?" New topic
Author

how to make Canvas transparent ?

Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
Hello all, sorry for the double posting but its different subject .
i have Canvas and i like to make its background transparent , but with no luck
the canvas is create on canvas parent .
can it be done with canvas ? or i need to use other control ?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Use JPanel instead of Canvas.
Canvas is a heavy weight AWT component where as JPanel is a light weight Swing component and both of them serve the same purpose.
To make the it transperant call


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
im using swt
Esai ADIDRAVID
Greenhorn

Joined: Dec 07, 2007
Posts: 2
Hi,
I was too facing the same problem. But anyway, the alternate approach may be to follow a different path.

Follow the hyper link. You should get the solution.
OnJava)

You use the AWT Canvas in SWT Application.

Regards,
Esai
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to make Canvas transparent ?
 
Similar Threads
How can i make canvas Transparent
Drawing Graphics in Layers?
Transparent JcomboBox
Background
Embossing a sprite on an image background