File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Question about internal components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Question about internal components" Watch "Question about internal components" New topic

Question about internal components

Craig Flannagan

Joined: Oct 21, 2001
Posts: 10
? 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)
return true;
else return false;

<blockquote><font size="1" face="Verdana, Arial">code:</font><hr><pre><font size="2"><br />boolean isDevilish(Human h)<br />{<br /> return (h==CraigFlannagan);<br />}<br /></font></pre><hr></blockquote>
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
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.
I agree. Here's the link:
subject: Question about internal components
It's not a secret anymore!