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 Color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Background Color" Watch "Applet Background Color" New topic

Applet Background Color

Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 249

Okay, when I use the setBackground() method to change the color of the background, nothing happens. Instead, my background is transparent. Why is this happening?

Here's my code:
Darryl Burke

Joined: May 03, 2008
Posts: 5098

Read the API for JApplet, particularly the second paragraph of the class description. Then observe that there is a "See Also" link. Click that link and go through the API documentation for the interface.

After that, go through the tutorial on Performing Custom Painting where you wilkl learn the correct way to do this in Swing.

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link:
subject: Applet Background Color
It's not a secret anymore!