Is there a method of knowing the depending library in the java library? If possible, I want to know the method to know by the tool or the command.
My method usually consists of googling the class and method and downloading the appropriate jar. :) Sometimes it takes some research.
Check classycle and JDepend, they both do dependency checks and can be used to automate process using ant.
JBoss TattleTale may help you, it's very easy to use.
"Tattletale is a tool that can help you get an overview of the project you are working on or a product that you depend on."
I'd suggest letting Maven handle your dependencies (NetBeans has good inbuilt support, for example). Once you're using it, it's easy to view the dependency tree.