Solved

transparent canvas

Posted on 1997-10-13
2
880 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 161
SHA2 certs for IIS AND Java? 2 136
String array comparison 4 57
ArrayList Adding/settign data 3 38
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

751 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