You have three options
1. java application
-------------------
Use this approach only if you want your application to be a standalone that
can be started just like any other standalone application. Here use java
swings for your need.
2. Applet
---------
Use this approach when you want to use web browser as client. Presently not
many prefers to use applet mainly due to performance related issue.
3. Servlet or JSP
-----------------
You can use this approach when you want to use web browser as client. Only
thing you need to fiddle with html and java code here.