Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to fill color for applet background??  RSS feed

 
may tan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello..

i wanna fill color for my applet background..
eg: gray color..

how do i do that?
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From within the JApplet class, use the setBackground method. With Swing you must also get the contentpane first of course:

The java.awt.Color class has a number of other colour constants you can use instead of gray.
 
may tan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello =)

thanks for ya coding, i'm able to get what i want.
was trying out e coding e whole, it wasn't successful until your code came in..

but i did modify a bit..
i put e code as: this.setBackground(Color.GRAY);

anyway thanks for ya helps!!
cheerios..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!