The problem is this. Java has a facility by which you may read a few parameters from the HTML that starts an applet to customize that applet. The problem with this is that that means if you want to change the applet's parameters, you're changing the HTML all of the time. This is especially a problem if you use the same applet in multiple places.
The solution to this is not to use the applet parameters, but instead to have a special, global file of parameters for your applet that's not ordinarily reachable from any of the rest of the HTML. Use a URLConnection to get the contents of the file and then process it with a stream.
-- KyleBrown
Using a URLConnection and a Properties file can avoid HTML params and also make your applet more 'portable' to application type usage...
URLConnection url = new URLConnection("http://foo.bar/MyApp.props"); Properties props = new Properties(); props.load( url.getInputStream() );-- StephenPetschulatString param1 = props.getProperty("parametername"); // etc.
This page mirrored in JavaIdioms as of April 29, 2006