aspose 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
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: 8971
    
    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]
 
wood burning stoves
 
subject: Is it possible to add a JPanel to AWT Frame?