I am writing an application that requires a login, and only after successful
login it starts the actual application. I decided to define a container in top
level wtkx file and then load wtkx file for login. I then set contents of the
top container to the contents of the login window. For example,
<content>
<Border wtkx:id="container" styles="{backgroundColor:null, padding:2}">
<content>
</content>
</Border>
</content>
Here is how I load the top wtkx file:
WTKXSerializer wtkxSerializer = new WTKXSerializer(); window = (Window)
wtkxSerializer.readObject(this, "root.wtkx"); contentPane = (Border)
wtkxSerializer.get(" container");
window.open(display);
I then load wtkx file for login using WTKXSerializer, and then call setContent
on the top level container, e.g.
contentPane.setContent(newWindow);
However, I am getting this error:
java.lang.IllegalArgumentException: Window parent must be null or display.
at org.apache.pivot.wtk.Window.setParent(Unknown Source) at
org.apache.pivot.wtk.Container.insert(Unknown Source) at
org.apache.pivot.wtk.Container.add(Unknown Source) at
org.apache.pivot.wtk.Border.setContent(Unknown Source) at
com.peak6.oh.client.ui.Main.startup(Main.java:183)
Can someone suggest how to fix it or better way to design such UI. Thanks.
______________________________________________
See http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email