File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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: 10826

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

Joined: Dec 07, 2007
Posts: 2
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.

You use the AWT Canvas in SWT Application.

I agree. Here's the link:
subject: how to make Canvas transparent ?
It's not a secret anymore!