Home pageFind It!Contact PJAPJA documentation

PJA

 PJA Toolkit forum

This forum is dedicated to PJA Toolkit.
You may read freely the messages it contents. If you want to write a message or answer to a subject, subscribe to it first.

Subjects Recent messages Login Subscribe

Messages of subject problem creating Frame in my servlet...

jplee

Location : Waltham, MA
Member since : Jun 29, 2004
Messages : 1
 Jun 29, 2004 at 6:53 PM
Hi,

My servlet program that generates PNG files from WMF data works fine on my desktop, but not on our Solaris server, so I am now using PJA inside my servlet, with:

Solaris 5.8
Apache Tomcat 4.1.27
JVM 1.4.1_01-b01

I have successfully run the ToolkitDemo1.2 on this server.
I tried setting headless=true, but was unsuccessful, so I set the CATALINA_OPTS (java cmd line for tomcat) to the options specified in the directions, and restarted Tomcat on this server.

-Xbootclasspath/a:/users/jplee/tools/pja_2.5/lib/pja.jar
-Dawt.toolkit=com.eteks.awt.PJAToolkit
-Djava2d.font.usePlatformFont=false
-Djava.awt.fonts=/usr/java/jre/lib/fonts
-Duser.home=/users/jplee/tools/pja_2.5
-classpath /users/jplee/tools/pja_2.5/lib/pjatools.jar

My web app recognizes the PJAToolkit.
My problem happens when I try to create an Image from a Frame. I send in the width and height, like so:

in main.java:

Image img = toolkit.createImage( decoder ); // decoder implements ImageProducer


in decoder.java.startProduction(): // ImageProducer method...
...
fr= new Frame();
fr.addNotify();

logger.info("d.width: "+ d.width);
logger.info("d.height: "+ d.height);
offscreen = fr.createImage(d.width,d.height);
logger.debug( fr );

...but the Frame comes back as, e.g.:

java.awt.Frame[frame26, 0, 0, 0x0, invalid, hidden, layout=java.awt.BorderLayout, title=, resizable, normal]

Note the size is "0X0".

On my Windows desktop machine, this value is "112x27", for the same image data I send in.

Furthermore, I cannot seem to call anything on the resultant Image in my main.java file - what I can't explain is why the Frame code works in the ToolkitDemo, but not in my servlet...


any help would be appreciated...

thanks,
jp
---
JPL


Home pageFind It!ContactTop

© Copyrights 1997-2014 eTeks - All rights reserved

PJAPJA documentation