If by running a java program in a web page you mean
the application runs within the context of the
browser, using all of its resources, I believe it has
to be an applet. applet can open other windows, once
loaded and look like a standalone application, if
that's what you are going for.
If you mean dynamic loading of various components over
the web into a java application, then you might want
to look at the web start. You can run any application
and you don't really need to have a browser or a web
page at all.