File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Applet Background(URGENT) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Background(URGENT)" Watch "Applet Background(URGENT)" New topic

Applet Background(URGENT)

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
I inserted background as an image in my HTML file in while I also downlad applet.
After downloading of the applet, background image cuts off. How Can I make applet background transperant so I can see the value and labels of applet with HTML background image.Rigth now I am using applet background color white.
Karen Parker

Joined: May 16, 2001
Posts: 15
I don't think it is possible to make an applet's background "transparent" so you can see the background of the HTML page behind it. There may, however, be a way to use the same background image within the applet to give that appearance.
If you're using Swing and your components are on a JPanel, I *think* you could draw the image on the JPanel, and it should appear underneath your components. I'm not much of an expert on Swing so someone please correct me if this is wrong.
Unfortunately, if you're using AWT, I can't think of any simple way to achieve the same effect...
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Override the paint() method of the applet and draw the image there... Applet extends the AWT panel... of course, if you are tiling an image, it doesn't always line up correctly in the applet and in the webpage background...


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Applet Background(URGENT)
It's not a secret anymore!