Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can i add a container to another container  RSS feed

 
narayana murthy pedapudi
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i add a container to another container.
is that possible. or else can i convert a part of getcontentpane to a Jpanel.
please help me in this regard
regards
narayana
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Container is a subclass of Component. You can add JPanels (for instance) to any other Container.
 
narayana murthy pedapudi
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the response,
but i need to add a Container cont, to another Container cont1. let me know is that possible.
if possible then how.
please tell me
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


:roll:
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Swing, every component is container as javax.swing.JComponent extends java.awt.Container. So you add container to another container without emphasising this in applications.
And for your reference, Containers are classified in to 3 categories :
1) Top-Level Containers - JWindow, JFrame etc.
2) Middle-Level Containers - JSplitPane, JTabbedPane etc.
3) Atomic Containers - JButton, JLabel etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!