Reputation: 2901
I have been working on a series of JPanel and I wanted to add a JFrame from another class to one of my panels. Can this be done.
Upvotes: 0
Views: 60
Reputation: 44808
No, you cannot add any Window
to another component, doing so results in a RuntimeException
. What you can do is add the contentPane
from the JFrame
to your JPanel
.
Upvotes: 1