aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "swing" Watch "swing" New topic
Author

swing

thanvi janu
Greenhorn

Joined: Nov 16, 2009
Posts: 29
difference between JPanel, JFrame and Container
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

Please Use A Meaningful Subject Line. About 90% of all threads in this forum is about Swing.

As for an answer:
- A JFrame is a subclass of Frame which is a subclass of Window. It is meant to be a toplevel component, meaning it is its own window.
- A JPanel is a container that must be put in another container or window. Without a parent window (either directly or indirectly; dialogs are windows too) it cannot be displayed.
- A Container is an AWT class and should therefore not be used in Swing. A JPanel is an indirect subclass of Container so use JPanel instead.

Also check out the Javadoc pages of all three and their super classes.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: swing