Java how to program errata

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sean Cleary

    Java how to program errata

    In Java How to program, 5th edition, I can not get past the example in
    chapter 3, page 89 to page 96. Is there some errata for this?
    I did not/could not load all the tools. I am coming from Slick edit
    and from Dos, and they both say that my copying of that example is
    flawed.

    Now I made a change: the name of the file is Lab2.java, the html file
    is Lab2.html.

    The contents of my Java file is:
    // fig 3.6 welcome Applet.java
    // A first applet in Java

    // Java packages
    import java.awt.Graphi cs; // import class graphics
    import javax.swing.JAp plet; // import class JApplet

    public class Lab2 extends JApplet {
    // draw text on applets background
    public void paint ( Graphics g )
    {
    // call super class version of the method paint
    super.paint( g );
    // draw a string at the x-coordinate 25 and y coordinate 25
    g.drawString( "Welcome to Java Programming", 25,25);

    }// end method paint
    }// end class Lab2

    The contents of the Html file is:
    <html>
    <applet code=Lab2.class " width="300" height= "45">
    </applet>
    </html>

    I am trying to learn Java on my own, and would greatly appriciate any
    assistance you can give.
    Sean
  • Sean Cleary

    #2
    Re: Java how to program errata

    seanearlyaug@ho tmail.com (Sean Cleary) wrote in message news:<1c5ac0c6. 0408181738.2794 3dda@posting.go ogle.com>...[color=blue]
    > In Java How to program, 5th edition, I can not get past the example in
    > chapter 3, page 89 to page 96. Is there some errata for this?
    > I did not/could not load all the tools. I am coming from Slick edit
    > and from Dos, and they both say that my copying of that example is
    > flawed.
    >
    > Now I made a change: the name of the file is Lab2.java, the html file
    > is Lab2.html.
    >
    > The contents of my Java file is:
    > // fig 3.6 welcome Applet.java
    > // A first applet in Java
    >
    > // Java packages
    > import java.awt.Graphi cs; // import class graphics
    > import javax.swing.JAp plet; // import class JApplet
    >
    > public class Lab2 extends JApplet {
    > // draw text on applets background
    > public void paint ( Graphics g )
    > {
    > // call super class version of the method paint
    > super.paint( g );
    > // draw a string at the x-coordinate 25 and y coordinate 25
    > g.drawString( "Welcome to Java Programming", 25,25);
    >
    > }// end method paint
    > }// end class Lab2
    >
    > The contents of the Html file is:
    > <html>
    > <applet code=Lab2.class " width="300" height= "45">
    > </applet>
    > </html>
    >
    > I am trying to learn Java on my own, and would greatly appriciate any
    > assistance you can give.
    > Sean[/color]

    This time the error message suggests that it can not find the
    Lab2.class file that is in the same directory. And does so even if the
    DOS utilities are used. Last time it was different, but I was
    struggling to learn how to change my editor to work well with HTML
    execution. Not that the error message then had anything to do with the
    HTML. So I have tried twice, and with all the fussing around, feels
    like more than twice.
    Sean

    Comment

    • Raymond DeCampo

      #3
      Re: Java how to program errata

      Sean,

      Please provide the exact commands you issued and the response from the
      program. Include what directory you issued the commands from and the
      contents of that directory and any other relevant ones.

      Ray

      --
      XML is the programmer's duct tape.

      Comment

      • Sean Cleary

        #4
        Re: Java how to program errata

        Raymond DeCampo <rdecampo@spam. twcny.spam.rr.s pam.com.spam> wrote in message news:<vhbVc.335 87$Kt5.31624@tw ister.nyroc.rr. com>...[color=blue]
        > Sean,
        >
        > Please provide the exact commands you issued and the response from the
        > program. Include what directory you issued the commands from and the
        > contents of that directory and any other relevant ones.
        >
        > Ray[/color]

        Ray,
        Thank you for your patience. I was gone a few days.
        Here is the Dos side of things: (actually the error message is from
        the slick edit side, but is identical on the DOS side):


        Volume in drive D has no label
        Volume Serial Number is 3FBD-636D
        Directory of D:\jlab\Lab2

        .. <DIR> 08-18-04 3:45p .
        ... <DIR> 08-18-04 3:45p ..
        LAB2 VPW 197 08-18-04 3:46p Lab2.vpw
        LAB2~1 VPW 814 08-21-04 6:49p Lab2.vpwhist
        LAB2 VPJ 9,447 08-18-04 4:27p Lab2.vpj
        LAB2 VTG 90,112 08-18-04 5:30p Lab2.vtg
        CLASSES <DIR> 08-18-04 4:02p classes
        LAB2~1 HTM 80 08-18-04 4:42p Lab2.html
        LAB2~1 JAV 577 08-18-04 5:31p Lab2.java
        LAB2 VPB 8,192 08-18-04 4:14p Lab2.vpb
        LAB2~1 CLA 395 08-18-04 4:30p Lab2.class
        LAB2DOS TXT 36 08-21-04 6:52p lab2dos.txt
        PATH TXT 238 08-21-04 6:50p path.txt
        DIR TXT 0 08-21-04 6:53p dir.txt
        11 file(s) 110,088 bytes
        3 dir(s) 11,260.27 MB free

        Volume in drive D has no label
        Volume Serial Number is 3FBD-636D
        Directory of D:\jlab\Lab2

        .. <DIR> 08-18-04 3:45p .
        ... <DIR> 08-18-04 3:45p ..
        LAB2 VPW 197 08-18-04 3:46p Lab2.vpw
        LAB2~1 VPW 814 08-21-04 6:49p Lab2.vpwhist
        LAB2 VPJ 9,447 08-18-04 4:27p Lab2.vpj
        LAB2 VTG 90,112 08-18-04 5:30p Lab2.vtg
        CLASSES <DIR> 08-18-04 4:02p classes
        LAB2~1 HTM 80 08-18-04 4:42p Lab2.html
        LAB2~1 JAV 577 08-18-04 5:31p Lab2.java
        LAB2 VPB 8,192 08-18-04 4:14p Lab2.vpb
        LAB2~1 CLA 395 08-18-04 4:30p Lab2.class
        LAB2DOS TXT 36 08-21-04 6:52p lab2dos.txt
        PATH TXT 238 08-21-04 6:50p path.txt
        DIR TXT 0 08-21-04 6:53p dir.txt
        11 file(s) 110,088 bytes
        3 dir(s) 11,260.27 MB free

        by using dos commands I should be able to cut through the slick edit
        problems, but I get the same thing anyway.
        Sean

        Comment

        Working...