Exercise 1: Editing the HTML File

In this lesson, you will learn how to edit the HTML file that the WorkShop created for you when you ran the Blink project. You will specify an applet parameter and add a link to the source code. Once you edit the file, you will save it under a different file name; otherwise your changes will be overwritten the next time you run the project.

If you haven't yet created and built the Blink project, you should do so now. Step-by-step instructions are in Creating a Project.

  1. Check the Java WorkShop tool bar for the name of the current portfolio and project.
    If the current portfolio is not "personal," choose Portfolio => Choose => personal. If the current project is not Blink, choose Project => Choose => Blink.

  2. Click the Source Editor control on the WorkShop tool bar.
    The WorkShop opens the Source Editor with Blink.java loaded. The file name appears in the name stripe at the top of the window.

  3. Choose File => Open from the Source Editor menu bar.
    The WorkShop opens a file chooser.

  4. Open the file Blink.tmp.html in your Blink directory.
    The file contains an applet tag that looks something like this:
    <applet
       name="Blink"
       code="Blink.class"
       codebase="/your_home_directory/.jws/Blink"
       width="500"
       height="600"
       align="Top"
       alt="If you had a java-enabled browser, you would see an applet here."
    > 
    <param name="lbl" value="Java WorkShop is really cool :-)">
    <hr>If your browser recognized the applet tag,
          you would see an applet here.<hr>
    </applet>
    

    The WorkShop created this file when you ran the project. The information is this file is based on the information in the Run tab in the Project Manager. If you have not previously run the project, see Running the Project.

  5. Choose File => Save As from the Source Editor menu bar.

  6. Enter a new name for the HTML file and save the file.
    Make sure you save the file in your Blink directory. If you do not rename the HTML file, your changes will be overwritten the next time you run the project.

  7. Change the value of height to 75.

  8. Add the following parameter before the lbl parameter.
    <param name="speed" value="50">
    

    This parameter increases the speed at which the words blink.

  9. Add the following link to the source code after the <applet> tag.
    <p>
    <a href="Blink.java">Source Code</a>
    

    The path to the source code must be relative to the HTML file.

  10. Click the Save control on the Source Editor tool bar.

Next lesson:

Exercise 2: Updating the Run Page