title: Java - How to detect that the internet connection has got disconnected through a java desktop application?
body: <p>I am developing a Java Desktop Application that access internet. It is a multi-threaded application, each thread do the same work (means each thread is an instance of same Thread class).</p>
  
  <p>Now, as all the threads need internet connection to be active, there should be some mechanism that detects whether an internet connection is active or not.</p>
  
  <p><b>Q1.</b> How to detect whether the internet connection is active or not?</p>
  
  <p><b>Q2.</b> Where to implement this internet-status-check-mechanism code? Should I start a separate thread for checking internet status regularly and notifies all the threads when the status changes from one state to another? Or should I let each thread check for the internet-status itself?</p>
  
  <p><b>Q3.</b> This issue should be a very common issue as every application accessing an internet should deal with this problem. So how other developers usually deal with this problem?</p>
  
  <p><b>Q4.</b> If you could give me a reference to a good demo application that addresses this issue then it would greatly help me.</p>