This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Background(URGENT)" Watch "Applet Background(URGENT)" New topic
Author

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.
Thanks
Angela
Karen Parker
Greenhorn

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
Bartender

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...

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet Background(URGENT)
 
Similar Threads
want background image in applet
URGENT HElP :
awt
setting background image in applet
adjusting image size according to the browser