Results 1 to 1 of 1
Thread: Detecting a lost Gui Connection
- 03-15-2011, 04:37 PM #1Member
- Join Date
- Mar 2011
- Rep Power
Detecting a lost Gui Connection
I am using linux computers and on one computer I am setting my DISPLAY to COMP1 and then starting a Java Gui program on COMP2. The problem is that when I disconnect the network cord or log out of COMP1 the Java program continues running fine on COMP2 without any indication that the display is no longer accessable. This is a problem because that Gui had a "master gui" status and since the process still thinks everything is fine it doesn't give up that "master gui" status so that it can be available for other guis.
Is there some way that I can detect if the connection (I think it might be the X connection) from the java process to the display is no longer available? If I can detect that then I can just have that process exit and free up the "master gui" status.
Iíve tried using GraphicsEnvironment but that doesn't work. GraphicsEnvironment.isHeadless() is always returning false even when I unplug the network cord. GraphicsEnvironment.getCenterPoint() is always returning a valid point. I was hoping it might return null or (0,0) if the network cord was unpluged.
- By jeffpaulwilson in forum AWT / SwingReplies: 2Last Post: 03-09-2011, 08:54 PM
- By antiC in forum New To JavaReplies: 1Last Post: 02-17-2011, 01:13 AM
- By tej in forum NetworkingReplies: 5Last Post: 05-08-2009, 03:37 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 12-24-2007, 11:05 AM
- By arupranjans in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 07-31-2007, 03:31 PM