Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes Just Java - Examples? Error help? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Just Java - Examples? Error help?" Watch "Just Java - Examples? Error help?" New topic

Just Java - Examples? Error help?

robyne vaughn
Ranch Hand

Joined: Jun 04, 2003
Posts: 39
I was a cobol programmer in a former life and have been having some trouble teaching myself java. In fact, I'm working on a project where even my co-workers don't know any java and can't be used as resources. Therefore, I'm always looking for "THE" book which will clear up whatever it is that I'm not understanding. One of the things which really helps, is a good example. So, I went to and copied your clock example. I compiled it on my AS/400 and have a couple of small errors. It is hard for noobes to know where to start to fix problems - even small ones, when there are so many unknowns. Does your book help the real beginner to find answers to problems?

ps: I encountered 2 errors when I compiled your code: class clock4 is public, should be declared in a file named

and cannot resolve symbol
symbol : variable EXIT_ON_CLOSE
location: interface javax.swing.WindowConstants

I've done enough to know that I needed to re-name the program. That fixed that.
The other is less clear to me, I believe I have to find the javax.swing stuff and put it in my class path. I'll work on that. My classpath was set up long ago, and I'm not sure if I remember right, how to add to it on the IBM iSeries AS/400 I'm using. I'll research that.

Any way, sorry for the long discourse. Still, a good beginner book has good examples and good help for when those examples don't work. Does your book have those?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

EXIT_ON_CLOSE was added to the WindowConstants interface in J2SDK 1.4. You must be using an older version of Java (1.2 or 1.3) -- you should upgrade if you can.

"Just Java" has been through six editions because Peter tries to keep it very current with cutting-edge features, so you really can't fault the code for not working with older versions of Java.

[Jess in Action][AskingGoodQuestions]
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
Maybe you are working with J2SDK 1.3 and there is not EXIT_ON_CLOSE constant.

SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Originally posted by David Ulicny:
Maybe you are working with J2SDK 1.3 and there is not EXIT_ON_CLOSE constant.

A quick check of the API's will tell you that EXIT_ON_CLOSE has been around since version 1.3 (for JFrame) and was added to the WindowConstants interface in version 1.4, so my guess is that Robyne's version is earlier.
[ September 29, 2004: Message edited by: Nigel Browne ]
robyne vaughn
Ranch Hand

Joined: Jun 04, 2003
Posts: 39
Thank you all for your responses.
I never meant to "fault" Peter for anything. My Ultimate question was about whether there were examples and help for errors. I should have specified "common" errors. It turns out that my problem with EXIT_ON_CLOSE will remain and is probably not common to those who are in a seasoned shop or who know something more about what they're doing.

I do not have access to J2S??.

That answers a question I had about what is the difference between Java and Java2.

I have access to JDK1.2 and JDK1.3. I choose to use JDK1.2 as it handles a certain JNDI problem for me better than the JDK1.3.

Anyway, if I in anyway implied fault, please forgive me. I was trying to ask an honest question and find out if this book is a good choice for someone so new to Java that they don't know what a JDK is.

I see that Peter's book serves a good purpose in keeping Java programmers up to date with the most current options.

I agree. Here's the link:
subject: Just Java - Examples? Error help?
It's not a secret anymore!