This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 8877
    
    8

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[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?