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 Painting Swing Components in Headless Environment

photo_ted

Location : Rochester, NY USA
Member since : Jan 7, 2009
Messages : 1
 Jan 7, 2009 at 2:58 AM
While I understand the changes to Java 1.5 allow many graphics operations to run in headless mode, I have a unique problem. I am working on an open source project that uses Java swing classes to create output which is then converted to an image and downloaded to a device that does not run Java. All the rendering is done on the server running Java and the device (Rio Receiver) is a simple output screen. While I can create any swing lightweight objects like JLabel, those objects cannot be painted without being in a heavyweight containter and by definition all heavyweight classes throw headless exceptions in headless mode.

See:

http://java.sun.com/products/jfc/tsc/articles/painting/

for an Sun article that confirms this.

Here is a quote from that article: "For a lightweight to exist, it needs a heavyweight somewhere up the containment hierarchy in order to have a place to paint."

Can PJA help?

Have I missed something in Java that will support this?

I am thinking of trying Xvfb (X virtual frame buffer) that should allow the OS to create a virtual "screen" allowing the program to run headless=false, but would prefer to solve the problem entirely in Java.

Tx,
Ted
---
Ted Mead

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Jan 7, 2009 at 9:04 PM
> Can PJA help?

No because its goal was to create offscreen images, and not to simulate a window look and feel.


> Have I missed something in Java that will support this?

I don't think so...


> I am thinking of trying Xvfb (X virtual frame buffer) that should allow the OS
> to create a virtual "screen" allowing the program to run headless=false

As far as I know, I think it's the only solution...
---
Manu (moderator/modérateur)

Pram

Location : India
Member since : May 19, 2014
Messages : 2
 May 19, 2014 at 3:12 PM
I am also facing similar issue. i.e. our application uses a tool which requires heavy weight awt components.
I could understand that PJA is meant exactly for that. But when i run it with have 1.6 env, getting "java.lang.ClassNotFoundException: sun.awt.FontProperties"... Any one tried PJA with java 1.6/1.7? I don't know which jar suppose to have class sun.awt.FontProperties. rt. jar??? Its not there any more?


Home pageFind It!ContactTop

© Copyrights 1997-2023 eTeks - All rights reserved

PJAPJA documentation