how can I detect and display all hardwares of a computer using java program?
Is there any way to detect hardwares plugged to a computer using java?For example,The program will be able to detect if a usb mouse is connected immidiately and show a message that an usb mouse is conne开发者_Go百科cted.
it is not possible with pure java. but you can use a native lib available on all important platforms, e.g. SIGAR lib from hyperic hq
This depends very much on the plattform your programm is running on.
in linux you can use the dbus api to register hardware changes
if you are only interestet in usb devices you should have a look at jusb (afaik there is even a windows port)
精彩评论