Solved

transparent canvas

Posted on 1997-10-13
2
879 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ejb on wildfly 5 45
mysql jsp example issue 32 67
Eclipse with various Java releases 7 42
Tomcat 9 + java 8 error while trying to deploy a war file 2 670
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

680 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