Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet Background Color

 
Joel Christophel
Ranch Hand
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic