You need to write JavaDoc comments in your code and then you can generate JavaDoc html.
JavaDoc comments are special comments which are between /** and */ and can be used to generate JavaDoc. e.g.
/**
* Class description.
* <p>
* Some more details
*
* @author Edd
*/
public class MyClass {
/**
* Method description.
*
* @param param
* important parameter
*/
public static void myMethod(String param) {
}
}
This would then look like this as a tooltip:

When you release your library for other developers to use, you would typically release it as a jar file. When you package up your jar you should also generate a javadoc.jar file to accompany your jar. This can then be used by other developers to get the usage tips.