File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Is it possible to add a JPanel to AWT Frame? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Is it possible to add a JPanel to AWT Frame?" Watch "Is it possible to add a JPanel to AWT Frame?" New topic
Author

Is it possible to add a JPanel to AWT Frame?

Leomino William
Greenhorn

Joined: Nov 01, 2004
Posts: 1
Folks,

Is it possible to add a JPanel with some swing components to AWT Frame?

If yes, how?


Thanks!

William
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8996
    
    9

java.awt.Frame has an add() method that takes a java.awt.Component, and JPanel has Component as an ancestor, so it's as easy as calling add(). However, mixing AWT and Swing components is discouraged as it can have some ugly side effects.


[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to add a JPanel to AWT Frame?