RE: How to use swing classes without X-server

2002-03-05 Thread Randy Layman


1.  Use JDK1.4 with its new headless command line option
2.  Use one of the psuedo-X servers (search the list archives, this
has been discussed numerous times and names of options and installation
directions should be listed).

Randy


 -Original Message-
 From: Serge A. Redchuk [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, March 05, 2002 10:40 AM
 To: [EMAIL PROTECTED]
 Subject: How to use swing classes without X-server
 
 
 Hello All !
 
 I want to use some of Swing classes like
 
 import javax.swing.tree.TreeModel;
 import javax.swing.tree.TreePath;
 
 by tomcat in environment where no X-server running.
 
 And I see in catalina.out:
 
 java.lang.InternalError: Can't connect to X11 window server 
 using ':0.0' as the
 value of the DISPLAY variable.
 at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
 at 
 sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:5
 9)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:120)
 at 
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi
 ronment.java:58)
 at sun.awt.motif.MToolkit.clinit(MToolkit.java:57)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:120)
 at java.awt.Toolkit$2.run(Toolkit.java:512)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:503)
 at java.awt.Toolkit.getEventQueue(Toolkit.java:1150)
 at java.awt.EventQueue.invokeLater(EventQueue.java:511)
 at 
 javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1091)
 at javax.swing.Timer.post(Timer.java:342)
 at 
 javax.swing.TimerQueue.postExpiredTimers(TimerQueue.java:195)
 at javax.swing.TimerQueue.run(TimerQueue.java:231)
 at java.lang.Thread.run(Thread.java:484)
 
 Huh !! I do not need X-server !!! I just want to use a pair of Swing
 classes.
 
 Anybody know what to do ???
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: How to use swing classes without X-server

2002-03-05 Thread Tom Oinn



Serge A. Redchuk wrote:
 
 Hello All !
 
 I want to use some of Swing classes like
 
 import javax.swing.tree.TreeModel;
 import javax.swing.tree.TreePath;
 
 by tomcat in environment where no X-server running.

snip

 Huh !! I do not need X-server !!! I just want to use a pair of Swing
 classes.
 
 Anybody know what to do ???

1) Wait until java 1.4 is solid enough to use in anger, I believe it
   gets around this problem.

2) Run the Xvfb (X Virtual Frame Buffer) on your server, and set the
   DISPLAY environment variable appropriately. We had to do this to
   get our farm nodes (no graphics) working properly.

Tom

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: How to use swing classes without X-server

2002-03-05 Thread Halfmann, Klaus


Serge A. Redchuk [mailto:[EMAIL PROTECTED]] wrote:
 
 Hello All !
 
 I want to use some of Swing classes like
 
 import javax.swing.tree.TreeModel;
 import javax.swing.tree.TreePath;
 
 by tomcat in environment where no X-server running.
 
 And I see in catalina.out:
 
 java.lang.InternalError: Can't connect to X11 window server 
 using ':0.0' as the
 value of the DISPLAY variable.
 at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
 at 
...
 at javax.swing.TimerQueue.run(TimerQueue.java:231)
 at java.lang.Thread.run(Thread.java:484)
 

You can use the _model_ classes from Swing without any problem as
long as you _never_ call any real GUI-classes. What you see here
is Swing starting its backgroud notification Thread. Look in your
code what classes you actually use. (JTree would be fatal 
DefaultMutableTreeNode would be ok.)

In case you abosultely _must_ use Graphics (like awt.image.)
You can use your existsing X-Server for testing. In a live system
you should use an Offscreen X-Server (such a thing comes with Linux
for such purposes).

   | Business Operation Systems GmbH
   |  _
 / | / \ \   Klaus Halfmann,  Dipl. Inform.
|  |/  /  |  
|   \_/   |  Tel. +49(0)69-24779-0 Fax +49(0)69-24779-444
 \   /   [EMAIL PROTECTED]
 

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]