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 PJA2.4 with tomcat4.1.29 under jdk1.3.1_10

damar

Member since : Feb 18, 2004
Messages : 3
 Feb 22, 2004 at 2:58 PM
Hi,

I have sent the following commandline options to complile program:

$JAVA -Xmx300M -cp $ANTJARS:$ENHYDRA_CLASSES:$JDKDIR/lib/tools.jar -Xbootclasspath/a:/opt/pja_2.4/lib/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatformFont=false -Djava.awt.fonts=/opt/java/jre/lib/fonts -Duser.home=/opt/pja_2.5Beta/lib -Dant.home=$ANT_HOME -DENHYDRA_DIR="/usr/local/enhydra5.0" org.apache.tools.ant.Main "$@"

And, the following is the snapshot of my program (I basically want to get the screen resolution on the client machine, and am using BarracudaMVC):

import java.awt.*;
import java.awt.Dimension;
import java.awt.Toolkit;

else if(key.equals("css")){

Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
double width=screenSize.getWidth();
if(width==640)
return "640x480.css";
else if(width==1024)
return "1024x768.css";
else return "800x600.css";
}
Since all options are sent java during compilation, I assume that I do not have to do any thing in Tomcat. Can somebody on the list point me what I have done wrong here?

Any pointers would be highly appreciated.

Damar

damar

Member since : Feb 18, 2004
Messages : 3
 Feb 23, 2004 at 3:34 PM
Hi,

It is me again.

Since my requirement for PJA is simple, can I do the following:

import com.eteks.awt.*;
import com.eteks.awt.PJAToolkit;
...
..

PJAToolkit kit=new PJAToolkit();
int width=kit.getScreenResolution();
if(width==640)
return "640x480.css";
else if(width==1024)
return "1024x768.css";
else return "800x600.css";
}

And simply put pja.jar in the classpath. What is wrong with this.

Any pointers would be highly appreciated.

Damar

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Feb 24, 2004 at 7:54 AM
> What is wrong with this.

Nothing is wrong excepted that PJA Toolkit getScreenResolution method always return the default 1024x768 screen resolution...
Keep in mind that PJA is supposed to replace default AWT Toolkit on a machine with no X11 display and no graphics card, so no real screen resolution is available.
Simply don't use PJA to get the screen resolution of the client machine.
---
Manu (moderator/modérateur)


Home pageFind It!ContactTop

© Copyrights 1997-2023 eTeks - All rights reserved

PJAPJA documentation