my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Background Color" Watch "Applet Background Color" New topic
Author

Applet Background Color

Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 231
    
    1

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
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Applet Background Color
 
Similar Threads
Problem with java layout and panels and containers
Draw Triangle
quadruple
Case statement
Recursion SnowFlake ?