|
NOTA: La traducción de esta documentación es un esfuerzo personal y voluntario, no es un documento oficial de Sun Microsystems
ni Oracle ni está patrocinado por ninguna de estas empresas. Los documentos originales (en inglés) están disponibles en:
http://java.sun.com/docs/books/tutorial/.
Dirija cualquier comentario, petición, felicitación, etc. a tutorialesjava_@RROBA_codexion.com. |
Si desea ayudar a mantener en funcionamiento esta web, colaborar con la traducción de estos documentos o necesita que se traduzca algĂșn capĂtulo en concreto puede realizar una donación directa mediante Paypal:
|
Now that you've provided all those nice parameters to the user, you need to help the user set the parameter values correctly. Of course, your applet's documentation should describe each parameter and give the user examples and hints of setting them. Your job doesn't stop there, though. You should also implement thegetParameterInfomethod so that it returns information about your applet's parameters. Browsers can use this information to help the user set your applet's parameter values.Below is an example of implementing the
getParameterInfomethod.As you can see, thepublic String[][] getParameterInfo() { String[][] info = { // Parameter Name Kind of Value Description {"imagesource", "URL", "a directory"}, {"startup", "URL", "displayed at startup"}, {"background", "URL", "displayed as background"}, {"startimage", "int", "start index"}, {"endimage", "int", "end index"}, {"namepattern", "URL", "used to generate indexed names"}, {"pause", "int", "milliseconds"}, {"pauses", "ints", "milliseconds"}, {"repeat", "boolean", "repeat or not"}, {"positions", "coordinates", "path"}, {"soundsource", "URL", "audio directory"}, {"soundtrack", "URL", "background music"}, {"sounds", "URLs", "audio samples"}, }; return info; }getParameterInfomethod must return an array of three-Stringarrays. In each three-Stringarray, the first string is the parameter name. The second string gives the user a hint about what general kind of value the applet needs for the parameter. The third string describes the meaning of the parameter.