Q:

Capture Network Connectivity Event

Is it possible to capture network events using Java?
For example, when I connect my ethenet adapter to a hub there is 'connectivity' and this is detected by windows XP and a 'bubble' displayed to the user. Does Windows also broadcast an event which can be captured by applications and more specifically applications written in Java?

A:

As far as I know there is not an event for this that Java can detect -- it's very OS specific.  What you can do is poll the available network interfaces every so often.
Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();

