fuadhamidov
Programmer
hi everybody
i have developed an applet (JApplet) project.
In this project i open new window (JFrame) on applet to get some input and i want to disable parent window (JApplet)
Although i have been able to lock parent, i can not stay child window(JFrame) always at the top of the parent window (JApplet)
it works fine while my "parent JPanel"s parent is JFrame
the code
i have developed an applet (JApplet) project.
In this project i open new window (JFrame) on applet to get some input and i want to disable parent window (JApplet)
Although i have been able to lock parent, i can not stay child window(JFrame) always at the top of the parent window (JApplet)
it works fine while my "parent JPanel"s parent is JFrame
the code
Code:
public void showChildPanel() {
new ChildPanel(getMyContainer(this.getParent())).show();
}
private Container getMyContainer( Container c ) {
while ( c != null ) {
if ( c instanceof JApplet ) {
//c = ( ( JApplet ) c ).getContentPane();
c = c.getParent();
c = c.getParent();
break;
} else if ( c instanceof JFrame ) {
break;
}
c = c.getParent();
}
return ( Container ) c;
}
Code:
public class ChildPanel extends JFrame {
public ChildPanel( Container _caller ) {
this.caller = _caller;
this.caller.setEnabled( false );
}
}