Win a copy of Functional Reactive Programming this week in the Other Languages 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