How can I easily provide default values for when applet parameters are not specified?
Created May 7, 2012
John Zukowski Here's a helper method that you can use to do that:
import java.applet.*; public class AppletUtils { private AppletUtils() {} public static String getParameter( Applet applet, String key, String keyDefault) { String value = applet.getParameter(key); return (value == null) ? keyDefault : value; } }Here's how to call:
String var = AppletUtils.getParameter(this, "name", "Jaeger");