This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about internal components

 
Craig Flannagan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
? about Swing: generally, do I have to set everything inside a JFrame to say, a certain colored background.. do I have to setBackground(Color) every internal component, or can I set it at top level, and anything that goes into the JFrame will automatically be .setBackgorund(Color)?
------------------
boolean isDevilish(Human h)
{
if(h==CraigFlannagan)
return true;
else return false;
}
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Craig,
Swing works exactly as AWT ... children will inherit any shared attributes from the parent. Therefore, you can set a background color on the top Frame and all its components will inherit the set background.
Regards,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic