File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes how to set applet transparent? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "how to set applet transparent?" Watch "how to set applet transparent?" New topic

how to set applet transparent?

Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
my applet is embedded in the HTML file. The HTML has a .jpg file as background color. How to set applet transparent without any color.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

You cannot make the background of an applet transparent... you can however, make it display your background image within the applet ( just pass the graphic in and do a drawImage() in paint, and then display the rest of your applet over it... ). However, in most cases this is not a satisfactory solution, since the applet will not line its background up with the background of the browser.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
hi, Nathan
Thanks for your reply. It helps.
It is sorta covered in the JavaRanch Style Guide.
subject: how to set applet transparent?
Similar Threads
applet transparency
JTree not updating after removing node and cant get background to change...
reg applet
setting applet's background color