Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default Detecting a lost X connection

    Hi,

    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.

  2. #2
    NRitH is offline Senior Member
    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    0

    Default

    Try using the java.awt.GraphicsEnvironment to query the graphics devices and configurations.

  3. #3
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    That didn'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.

Similar Threads

  1. detecting folder listing
    By antiC in forum New To Java
    Replies: 1
    Last Post: 02-17-2011, 12:13 AM
  2. detecting location of ipaddress
    By tej in forum Networking
    Replies: 5
    Last Post: 05-08-2009, 02:37 PM
  3. Detecting software installed in PC
    By Lukalo in forum Advanced Java
    Replies: 3
    Last Post: 02-13-2009, 03:04 AM
  4. detecting flooding attack
    By prashant in forum Networking
    Replies: 1
    Last Post: 12-27-2008, 08:44 PM
  5. Detecting browser with JSP scriptlet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-24-2007, 10:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •