I'm just beginning out with Apache Pivot and started with Hello BXML example on their site. The applet just displays a grey rectangle and nothing more. I've deployed the application under tomcat with following structure: hellopivot
- lib/pivot-*.jar
- org.apache.pivot.tutorials.HelloBxml
- scripts/deployJava.js
- index.html
- hello.bxml
index.html:
<script type="text/javascript">var attributes = {
code : "org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
width : "240",
height : "80"
};
var libraries = [];
libraries.push("lib/pivot-core-2.0.jar");
libraries.push("lib/pivot-wtk-2.0.jar");
libraries.push("lib/pivot-wtk-terra-2.0.jar");
libraries.push("lib/pivot-web-2.0.jar");
libraries.push("lib/pivot-web-server-2.0.jar");
attributes.archive = libraries.join(",");
var parameters = {
codebase_lookup : false,
application_class_name : 'org.apache.pivot.tutorials.HelloBxml'
};
var javaArguments = [ "-Dsun.awt.noerasebackground=true",
"-Dsun.awt.erasebackgroundonresize=true" ];
parameters.java_arguments = javaArguments.join(" ");
deployJava.runApplet(attributes, parameters, "1.6");
</script>
hello.bxml
<Window title="Hello BXML!" maximized="true"
xmlns:bxml="http://pivot.apache.org/bxml"
xmlns="org.apache.pivot.wtk">
<Label text="Hello BXML!"
styles="{font:'Arial bold 24', color:'#ff0000',
horizontalAlignment:'center', verticalAlignment:'center'}"/>
</Window>
HelloBxml.java
@Override
public void startup(Display display, Map<String, String> properties)
throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
window = (Window)bxmlSerializer.readObject(HelloBxml.class, "hello.bxml");
window.open(display);
}
What am I doing wrong?