There is no way to disable the toolbar from Java — for good reason. Keep in mind that Java is not tied to any particular browser or operating system, and therefore should not depend on the particular user-interface implementations of Netscape or Hotjava or Internet Explorer. There may not be a forward or backward button at all — stand-alone Java applications or Java’s Appletviewer certainly don’t have forward/back buttons and future browsers may have much more sophisticated navigation controls than just forward/back buttons.
The problem you mention is valid, however. How does one make it easy to use a real-life application on the Web without running into a UI disaster? For instance, when the user leaves the page, should the applet be killed or should it keep running but suspend itself? What if you bring up another copy of that page while the old instance of the applet is already running? One solution is to advise the user to spawn a new browser window for an applet that might stay on the screen for a while. This is rather clumsy especially because multiple browser windows clutter up the screen very quickly and are hard to manipulate.
Fortunately, Java does give the programmer quite a bit of control over an applet’s behavior as the user navigates the web. This is provided through three methods in the Applet class:
destroy(). The programmer can override the default implementations of these methods to clean up or initialize the applet as needed.
stop() method is called whenever the applet disappears from view – either because the user went to a different page or because the browser was iconified.The
start() method is called whenever an applet is just about to start, or comes back into view — when the user clicks on the back button or when the browser is deiconified, for example. Finally the
destroy() method is called whenever the applet’s page drops off of the user’s history list such that there is no way for the user to get back to the page by pressing the back button.