• Post Reply Bookmark Topic Watch Topic
  • New Topic

What are the parent components and what are the child components  RSS feed

 
abdul halim
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep hearing these two term when it comes to painting in Swing, however, I'm not sure which is which.
to my understanding is that the child components are the ones that already exist on screen (could be a JButton, JFrame, or custom painting) . and the parent components are the one to be added/drawn next. (hence, if we override the paintChildren() method when painting, the components that were already on the screen don't appear any more)
can someone validate this for me as my head is starting to hurt from thinking about, LOL
 
Campbell Ritchie
Marshal
Posts: 55785
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I am afraid that explanation is incorrect.
A “parent” component surrounds a “child” component.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!