Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Data

How is data supplied to a Java applet?

readParam()

Data can easily be supplied to an applet on PARAM tags in the HTML document as shown in the following example.

<PARAM NAME=a0 VALUE="Diana Luckevich|info@doubleologic.com">

This parameter has two values separated with a delimiter of "|". The first value contains the name "Diana Luckevich" which we put in our itemList. The second value contains "info@doubleologic.com" which we put into the email_address array. Though both values are placed in different data structures, each will be referenced with the same relative index. The Contact applet attempts to read 50 parameters from the HTML document. The readParam() method has a loop that executes 50 times in search of parameters in the HTML. The statement param_data = getParameter("a" + j) searches for parameters with the names a1, a2, a3 all the way to a50.

The statement if (param_data != null) determines if there is input data in the parameter. If true, a StringTokenizer object is created with this statement st = new StringTokenizer(param_data,"|");. The StringTokenizer is a very powerful object that locates tokens within a String. Tokens are delimited text strings. The delimiter, "|" is defined when the StringTokenizer object is created. The if (st.hasMoreTokens()) statement determines if there is another token in the string. The statement email_name = st.nextToken() retrieves the next token in the String and places it in the method variable email_name. The next token is retrieved from the String and both values are stored in the appropriate data structure for later use.

When a method is called within its own class it is not preceded with a dot. For example when we call readParam(); nothing precedes it. When calling the nextToken() method of the st object like st.nextToken(); the dot must be there. You can optionally code this.readParam(). The "this" keyword is a special way to refer to the current object when code clarity is required, though this technique is rarely used in such a simple applet.

Previous Next



Up to => Home / Authoring / Java / Intro




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers