Is this possible to add a JFrame into a JPanel in Java. i m using a java program which is giving output as a frame which i wanted to display inside another program's JPanel on click of a button. How can i do this?
Read about JInternalFrame
. I think it's the way to go here.
http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html
You could call getContentPane()
on the JFrame to extract its main contents as a JPanel (usually) and without the menu bar and decorations, and display that as a JPanel though best would probably be to update the original program so that it produces a JPanel and not a JFrame.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With