Jeff Albertson

Ranch Hand
+ Follow
since Sep 16, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeff Albertson

Why not export your sample program as a JAR so that you don't have to fiddle with the environment variables on all your students' machines?
12 years ago
To do number formatting, use NumberFormat or DecimalFormat
12 years ago

Originally posted by rathi ji:

It's free. You can later on opt for it.



What if she *gasp* doesn't know Java?
12 years ago
Long ago I remember people using the term "apeshit":

I don't know what happened. One minute he was fine, the next minute he went apeshit and started trashing the place.

Haven't heard that word used in a long time.

On another simian scat note, one of my favorite songs has the lines:

Like a monkey that lives in the zoo
I have a bad day, I throw my shit at you

Oh, yeah...
12 years ago

Originally posted by Vinay Belagavi:
java -cp is used for class search path of directories..you can go to System Properties-->Advance-->Environments variables and add "C:\Program Files\Java\jdk1.5.0_06\bin" path in the path variable. Check the version of jdk you have.



Argh! PATH != CLASSPATH

Original Poster: there are other ways of running a Java Program, but I think messing with the CLASSPATH environment variable is one of the worst. Two better ways are:

1. Zipping your code into an executable JAR file. (You can google that)
2. Using Ant.
12 years ago

Originally posted by Campbell Ritchie:
I think is is very unfortunate that the Java tutorial uses addActionListener(this) passim.



Indeed. Is there anything in the Java Tutorial about *good* design? They should at least note this is just an expedient.
12 years ago
You're right, I'd don't see the big advantage to having *some* methods allow chaining, especially why other PrintWriter methods don't. For example, you can write:

but not

Because all the print methods have void return type. (One could argue that it's time to use printf, but not everyone likes using formating when they don't have to...)

Did you notice the cool thing happening in PrintWriter? It implements Appendable:

And when it implements these methods, it uses Java 1.5's covariant return types to change the return type of these methods to PrintWriter. (I can't think of another place in the API that they use CRT ...) The API for Appendable also states:

The Appendable interface must be implemented by any class whose instances are intended to receive formatted output from a Formatter.

A-ha...
12 years ago
By images I thought you meant images -- jpeg, png etc... Now you start mentioning Microsoft's different document formats, and you're getting into sticky areas that make me wonder why you're writing any part of this in Java...
12 years ago
No matter how you choose to define "OOPS" ...

cout << "I'm glad Java doesn't allow operator overloading";
12 years ago
Have you considered using Java to display the image?
12 years ago
BASIC, eh? Well, what you have here is JavaScript and this forum is for Java, an unrelated language. Perhaps you meant to go here:

http://www.coderanch.com/forums/f-20/HTML-JavaScript
12 years ago

Originally posted by jake bellhorn:
i would but the teacher said we cant get any help other then the internet



Are you in pre-law? TBecause this seems like hairsplitting. Perhaps your teacher meant that you could use resources from the internet like javadocs, FAQs and tutorials. On the other hand, what is the difference between someone helping you debug in person versus via this forum, apart from the fact that it's 100 times more tedious to do it the latter way...
12 years ago