createImage sometime returns null and sometime returns non-null.

createImage sometime returns null and sometime returns non-null.

Post by lianjia » Wed, 01 Dec 2004 13:04:21


Hi:
I am debugging an Java standalone application and some servlets in
eclipse3.0.
I am using tomcat5.5 and jre1.5.0.
There is a file, called FlowChart.java, which will be used in the
Java standalone application and also used (called) by a servlet.


public class FlowChart extends JComponent implements
Serializable,MouseMotionListener,Printable {
...
Image backDrop=createImage(800,600);
...
}

When I debug the Java standalone application in eclipse, the
createImage() returns a non-null pointer. But when I debug the
servlets in eclipse, createImage() returns a null pointer.

Why???

One reason I guess is that eclipse uses its own libraries and
compiler to debug the standalone application, while the servlets are
debugged by using external jre1.5.0. There is some difference between
the jre1.5.0 and the eclipse's coming-with libraries. Is it true?

I have stucked on this problem for a long time.

Highly appreciate anyone giving me a way out!

Best
 
 
 

createImage sometime returns null and sometime returns non-null.

Post by Andrew Tho » Wed, 01 Dec 2004 13:27:22


...

GraphicsEnvironment.isHeadless() ?


Try getting acquainted with the JavaDocs, perhaps.
< http://www.yqcomputer.com/ #createImage(int,%20int)>

--
Andrew Thompson
http://www.yqcomputer.com/
http://www.yqcomputer.com/
http://www.yqcomputer.com/
http://www.yqcomputer.com/