I am new to swings, I have a requirement that i should show a message like "you are offline " when my network cable is unplugged and "You are now connected" when I plug network cable to my system. This should happen automatically.
First of all, it is 'Swing' and not swings as mentioned in the FAQ.
There is a class java.net.NetworkInterface which I think you can use to get the connected networks - I have never tried this though. You can read about this in the tutorial.
In any case, I think you will need a Timer as mentioned.
SCJP 1.4, OCMJEA/SCEA 5.0.
Joined: Jun 15, 2012
Michael Dunn wrote:perhaps a timer to constantly try a url connection might work, but it seems sloppy
is it possible to catch system notifications( balloon messages showing "network cable is unplugged" in windows operating system )and show on JLabel....?