how can automatic detect usb modem with java

Hello and welcome to Daniweb.

As you are new I would advise that you clarify your question. Include what you want it to do exactly, what you will be using it for and any other relevant info. The more information you provide the quicker we can help.