• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting applet's background color

 
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How do I set background color for applet?
thanks,
Alex
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic