Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Unable to set JApplet Background Color
  2. public class QuoteApplet extends JApplet
  3. {
  4.  
  5.     public void paint (Graphics appPage)
  6.     {
  7.         setBackground(Color.YELLOW);
  8.  
  9.         appPage.drawRect(65,55,255,100);
  10.         //page.drawRect(60,80,225,30);
  11.         //page.drawOval(75,65, 20, 20);
  12.         appPage.drawLine(30,30,30,100);
  13.         appPage.drawLine(40,30,40,100);
  14.         appPage.drawLine(55,45,15,85);
  15.  
  16.         appPage.drawString("There once lived a man named Oedipus Rex.", 70, 70);
  17.         appPage.drawString("You may have heard about his odd complex.", 70, 90);
  18.         appPage.drawString("His name appears in Freud's index,", 70, 110);
  19.         appPage.drawString("'cause he loved his mother.", 70, 130);
  20.         appPage.drawString("-Tom Lehrer", 200, 150);
  21.     }
  22. }