Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to activate the options in a dialog box if a usb device is inserted into the system and gets deactivated if ub device is removed? The actions are very similar to the connect/disconnect options of a dalog box of a usb modem. I need the java code for this. please help.
Posted
Updated 3-Jul-13 23:43pm
v2
Comments
Richard MacCutchan 4-Jul-13 6:13am    
Your code would need to hook into the OS so that it receives a message when the device is added or removed from the system. I do not think you can do that directly in Java, but see this white paper.

1 solution

In java you have to listen the serial port to track the usb. Using javax.comm you can able to read the serial port. You can start from here .

http://docs.oracle.com/cd/E17802_01/products/products/javacomm/reference/api/javax/comm/package-summary.html[^]

Another good article regarding this :

http://www.ibm.com/developerworks/library/j-usb/index.html[^]
 
Share this answer
 
Comments
Anushmita Paul 4-Jul-13 10:37am    
Umm basically I am designing a software for a proximity based radar system. I have made a beta version on vc++ but I am atotal novice in java with almost no knowledge in it. So i need to know about the usb thing, plus how to change into manual and auto modes for doppler and FMCW modes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900