Graphical terminal check

Hi,

I am a not familar with java. I am facing a problem with a Java application. When a X Windows is not running java GUI is failing with an error

" Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'MyIPaddress:0.0' as the value of the DISPLAY variable.

at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)

at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:57)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java, Compiled Code)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java, Compiled Code)"

How can I check whether the application is invoked from a graphical terminal? I like to know this before calling the application.

Thanks in advance

jesme

[870 byte] By [jesme] at [2007-9-27 15:07:54]
# 1
Well, you could try & catch the exception. In the main method, just do a try and then catch around your code. Or perhaps you can use something like getScreenResolution() in Toolkit.getDefaultToolkit().
nalenb at 2007-7-5 23:08:13 > top of Java-index,Desktop,Core GUI APIs...