If your Java code runs on the server (
servlet or
JSP): no, modulo the workarounds suggested by Eric.
If your Java code runs on the client (
applet): yes, but it depends.
I agree with Bear that a longer, more nuanced, answer is not possible due to lack of information.