By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,441 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,441 IT Pros & Developers. It's quick & easy.

Java how to program errata

P: n/a
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.Graphics; // import class graphics
import javax.swing.JApplet; // 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
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
se**********@hotmail.com (Sean Cleary) wrote in message news:<1c**************************@posting.google. com>...
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.Graphics; // import class graphics
import javax.swing.JApplet; // 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


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
Jul 17 '05 #2

P: n/a
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.
Jul 17 '05 #3

P: n/a
Raymond DeCampo <rd******@spam.twcny.spam.rr.spam.com.spam> wrote in message news:<vh*******************@twister.nyroc.rr.com>. ..
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


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
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.