getParent returns null
843807May 12 2004 — edited May 12 2004myApplet has a simple button on the middle of the Applet, when user clicks on the button a instance of JFrame pops up. when user closes the JFrame, I want to enable the button on the applet. So I want to getParent of JFrame, so I can get the button.
Component parent = jFrame.getParent();
To my surprise, parent is null already. Since I want to pass the parent to my following method to get myApplet.
private MyApplet getPopApplet(Component parent){
while(parent!=null && !(parent instanceof PopApplet)) {
System.out.println("not popApplet");
parent= ((Component)parent).getParent();
}
return (PopApplet)parent;
}
Any idear? Who jFrame.getParent is already null?