Solved

transparent canvas

Posted on 1997-10-13
2
873 Views
Last Modified: 2012-06-21
I have an applet with a panel.  I add canvas' to it, and I use the mouseDrag method to allow the user to move the graphics around the "desktop".  I couldn't use the mouseDrag if I didn't use the canvas.  But now I have to put transparent gifs in for graphics, but you only see the background of the canvas that the image is in through the transparency of the gif.  Is there any way to have the canvas be transparent so I can see the other images through the transparencies?

Seth
0
Comment
Question by:seth23
2 Comments
 
LVL 1

Accepted Solution

by:
mnelson051997 earned 100 total points
ID: 1228524
The way to have a transparent component is to use
the Component class instead of Canvas.  Using
Component means there is no peer involved, so if
you don't paint in an area, and update() is not
filling in the background, you see straight through.
This is what the JDK 1.1 calls a "lightweight"
component.
0
 

Author Comment

by:seth23
ID: 1228525
I am waiting to grade this.  I just asked another question about this problem, having to do with a problem that arises when I make the canvas into a component, and I can't test the transparency problem until the other problem is fixed.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now