• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting applet's background color

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How do I set background color for applet?
thanks,
Alex
 
Hugh Savoie
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setBackground(Color.white)
Use the following if it's a panel on top of another panel.
pnlName.setBackground(Color.white) you can replace white with any of the 11 standard colors in the API.
You can also create your own color.
Color giveItAName = new Color(50,100,150)
50, 100, 150 represents R,G,B values.
You would then use.
setBackground(giveItAName)
or
pnlName.setBackground(giveItAName)
Keep in mind that if you set a color on a panel to �yellow�all panels added to that panel will also be yellow, unless you change the color of the that panel by prefixing the setBackground method with the panel name.
Regards,
Hugh

[This message has been edited by Hugh Savoie (edited October 16, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic