Creating an Applet User Interface |
Parameters are to applets what command-line arguments are to applications. They allow the user to customize the applet's operation. By defining parameters, you can increase your applet's flexibility, making your applet work in multiple situations without recoding and recompiling it.Deciding Which Parameters to Support
When implementing parameters, you must answer three questions:
- What parameters should the applet define?
- What kind of values will each parameter take?
- What will the default value of each parameter be?
Writing the Code to Support Parameters
Applets get the user-defined values of parameters by calling thegetParameter()
method.Giving Information about Parameters
By implementing thegetParameterInfo()
method, applets provide information that browsers can use to help the user set parameter values.
Creating an Applet User Interface |