• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to show a message on my swings frame automatically when my network cable is unplugged

 
krishna neerukonda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
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.

Thanks in Advance,
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and(s) the(s) question(s) related(s) to(s) swing(s) is(s)?
 
krishna neerukonda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:and(s) the(s) question(s) related(s) to(s) swing(s) is(s)?


can you post some solution please
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perhaps a timer to constantly try a url connection might work, but it seems sloppy
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
krishna neerukonda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....?
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps using JNI, although I wouldn't know the API calls and hooks to use myself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic