Tom Never

Greenhorn
+ Follow
since Jan 11, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Tom Never

Thanks. I'm still learning my way around packages/api documentation. It's amazing what they don't tell you.
19 years ago
I am reading the sun tutorial and I don't see in this code where the 2nd addActionListener is in the code for both the enter and button. They write in the tutorial:

We want to perform the conversion when the user clicks the button or presses Enter in the text field. To do so, we add an action event listener to the convertTemp button and tempCelsius text field.

convertTemp.addActionListener(this);
tempCelsius.addActionListener(this);
...


But I don't see it in the code. It works, for both button and enter, but where is it in the code? Thanks, Tom

I]
19 years ago
I've been working through Head First, and on Chapter 4 now. My question is: Do other readers of this book figure out the answers in their head? or by scribbling on paper? I have to type in the program and run it for results. Am I just not understanding what is going on in the programs?
signed,
slow learner
19 years ago
My path statement for windows XP has jdk1.5.0_06\bin That's where java.ex exits, I wouldn't put in the java.exe either.
Tom

C:\Program Files\Java\jdk1.5.0_06\scr.zip;C:\Program Files\Java\jdk1.5.0_06\javac.exe;C:\Program Files\Java\jdk1.5.0_06\java.exe

I've also tried with the same lines but unnaming files (finishing with '\')

What am I doing wrong?

Thank you very much for your attention and help.
Merry Christmas and Happy New Year!!

And I hope the Three Wise Men bring you everything!! [/QB]
19 years ago
I hand typed in the page 14 script for "99 bottles of beer" and it won't compile, says line 9(While (beerNum > 0) is wrong. What did I do wrong?
thanks,
Tom

C:\Documents and Settings\3441\My Documents\working_java>javac BeerSong.java
BeerSong.java:9: ';' expected
{
^
1 error

C:\Documents and Settings\3441\My Documents\working_java>

here is what I typed in:
public class BeerSong
{
public static void main (String[] args)
{
int beerNum = 99;
String word = "bottles";

While (beerNum > 0)
{

if (beerNum == 1)
{
word = "bottle"; // singular as in one bottle
}
System.out.println(beerNum + " " + word + " of beer on the wall");
System.out.println(beerNum + " " + word + " of beer");
System.out.println("Take one down.");
System.out.println("pass it around.");
beerNum = beerNum - 1;

if (beerNum > 0)
{ System.out.println(beerNum + " " + word + " of beer on the wall");
}
else
{
System.out.println("No more bottles of beer on the wall");
} //end else
} // end while loop
} //end main method
} //end class
19 years ago
I just bought the book, and am only on page 14. And am having problems with 99 bottles of beer on the wall, which I will post separately.
Tom

Originally posted by Stuart Goss:
[QB]Hi there!

Is anybody on this forum reading the "Head First Java" book by Ms. Sierra and Mr. Bates currently?

19 years ago