Invoke JDialog into Custom JInternalFrame

215 Views Asked by At

In a beginning I tested my project in a JFrame, but after I tried to emigrate it to a custom JInternalFrame from another existent project, it gives me a incompatibility error, because a JInternalFrame can not be converted to Frame.

I do the invoke with this:

MyJDialog mjd = new MyJDialog(this,false,myobject);

Constructor of my JDialog:

public MyJDialog(java.awt.Frame parent,boolean modal,Object myobject) {
super(parent,modal); /*This part it's giving me conflict due JInternalFrame can not be converted to Frame*/
//another code
}

So, which function can I use to replace "super" or which solution can I apply?

1

There are 1 best solutions below

0
Vlad On

Thanks to MadProgrammer, the solutions it's as follow:

The invoke:

MyJDialog mjd = new MyJDialog(javax.swing.SwingUtilities.getWindowAncestor(this),myobject);

Constructor of my JDialog:

public MyJDialog(java.awt.Window parent,Object myobject) {
    super(parent,"");
    //another code
}