I completed my project which assigned to me by university but now I am trying to create MDI for my project. I used 10 jFrame and one main form which is also jFrame, after that I add one Menu Bar, 10 jButtons for calling jFrame and one jDesktopPane for place calling jFrame. The below code using for calling jFrame place into jDesktopPane in all 10 jButton:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try
{
asd t = new asd();
dskp.add(t);
t.setVisible(true);
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null, ex);
}
}
but not working with me and giving below error message:
java.lang.illegalargumentexception: adding a window to a container
How to do this and solve this issue because I didn't used any jInternal Frame. I think at this I am not able to use jInternale Frame because I did all work on jFrame such as full GUI with code and re-doing all work on jInternal Frame its not possible for me coz of short of time to submitting my final project.