0

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?

Deepak Marur
  • 537
  • 1
  • 13
  • 27
  • I am getting exactly the same thing with a desktop app I built using Pivot. It works fine under windows, but linux just presents a grey box until I tab in and out then hover the mouse over any components that have a hover redraw. – Geoffrey Aug 31 '15 at 09:24

2 Answers2

0

Try adding the "lib/pivot-tutorials-2.0.jar" to your libraries list. That is where the 'org.apache.pivot.tutorials.HelloBxml' class file lives.

rwhitcomb
  • 106
  • 2
0

(Disclosure - Apache Pivot PMC member)

How are you attempting to view the applet?
Which OS, JVM, browser etc are you using?

Are you able to view the hosted version of that applet using the same client configuration as the failing 'local' version? HelloBXML at offical Apache Pivot site

Do you have problems viewing any of the other Pivot applets hosted at the official site? (Demos or Tutorials?)

Issues with applets in linux environments have been reported that sound similar to your experience.

  • Also, be aware that Apache Pivot has [mailing lists](http://pivot.apache.org/lists.html) for users and developers which are archived and may prove useful to you. There are also unofficial Nabble mailing list archives here http://apache-pivot-users.399431.n3.nabble.com/ http://apache-pivot-developers.417237.n3.nabble.com/ – Chris Bartlett Mar 31 '12 at 13:21