473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.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
3 2386
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

55
by: Elijah | last post by:
I have read many of the topics on learning C++ or Java first. It seems like everyone says something different. I would like to know if I should learn C++ or Java. First a little about myself. I...
1
by: Charles L | last post by:
Does anyone know where I can find errata for Stan Lippman's 'C++ Primer 2nd Edition'? Charles Leng
7
by: Fraser Ross | last post by:
http://erdani.org/errata/ I'm using IE6 which might not be compatible with this page. I've tried the lowest security setting. All I get is the error nosh. Is the page working for anyone else?...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
0
by: cincerite | last post by:
Hello , guys , I'm reading C++ Primer 3rd edition recently.I tried to download the errata of it from Stan Lippman's Home Page:http:// staff.develop.com/slip/ ,but it says:We're Sorry, we could not...
10
by: Zach | last post by:
I am looking for a comprehensive list of errors in Kernighan & Ritchie's "The C Programming Lanuage: 2nd Edition (ANSI C)" Also what is the best way to work through the list with the Errata? I...
0
by: Ioannis Vranos | last post by:
Eric Sosman wrote: Well, if we all provided solutions for the ambiguous errata of K&R2 and posted them here and sending them to K&R errata site, and/or perhaps added to clc FAQ, I think would...
7
by: Ioannis Vranos | last post by:
In K&R2 errata page <http://www-db-out.research.bell-labs.com/cm/cs/cbook/2ediffs.html> there are some ambiguous errata, for which I propose solutions. Any comments are welcome. Ambiguous...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.