<Shell
name="Shell"
text="Main Shell"
bounds="0,0,640,480">
</Shell>
<Shell
x:style="SHELL_TRIM|APPLICATION_MODAL"
name="Shell"
text="Child Shell"
bounds="0,0,640,480">
</Shell>
public class MainShell {
public static void main(String[] args) {
Shell mainShell = (Shell)XWT.load(new File("main_shell.xwt").toURI().toURL());
mainShell.open();
// do something...
Shell childShell = (Shell)XWT.load(mainShell, new File("child_shell.xwt").toURI().toURL());
childShell.open();
System.out.print(childShell.getParent()); // <--- I got "null" here, but it should be "Shell {Main Shell}", right?
while (!mainShell.isDisposed()) {
if (!mainShell.getDisplay().readAndDispatch()) {
mainShell.getDisplay().sleep();
}
}
}
}