Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Martin Clifford

Greenhorn
+ Follow
since Dec 02, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Martin Clifford


When using the post-increment/post-decrement operators, the increment/decrement is applied to the value of the variable AFTER the operation is performed. Hence the prefix 'post'.
Line 1: variable i is initialized to zero.
Line 2: variable i is printed BEFORE the statement finishes execution, so it prints 0, then the value of i is incremented by 1, to 1.
Hope this helps some. This type of stuff can be confusing, I know.
I just started reading this book by Kathy and Bert, and have to say that it's grabbed my attention so far! That's something that not many of these Cert books has been able to do )
Mike Meyer's Certification Passport for Java 2 is also very good, though apparently for the 1.2 exam, not 1.4.
Good luck!
That makes much more sense than anything I've been able to think of. Thanks you two!
19 years ago

Originally posted by Jeff Wisard:
System.out.println(Float.parseFloat("42.44"));


It seems to work fine for me. I can't tell you why it doesn't work for you. If it persists, take a look at NumberFormat, and see if anything there helps.
Good luck!
19 years ago
Hi everyone!
Recently I have been experimenting with I/O, and ran across this little ditty. Can any explain to me why the following method has to throw a ClassNotFoundException?

Any explanations are welcome! Thank you! )
19 years ago
Thank you both for your replies! The example code led me to a MUCH MUCH better understanding of how GridBagLayout works! God I love this forum! )
Thanks again!
Your very much indebted protege` (hehe),
19 years ago
Hey everyone!
I am trying to build an application, but I'm getting hung up on the layout manager to use to get the program 'looking right.' Here's what it should have:
The window is 700px by 600px. I want a panel to occupy, starting at 0, 0 coords, 400px by 600px. Then, starting at 405, 0 coords, an area 295px by 300px. The last section, will start at 405, 305 coords, and be 295px by 295px. Here's a crappy ascii drawing of what it should look like.
___________________
|*********|******|
|*********|******|
|*********|******|
|*********|_______|
|*********|******|
|*********|******|
|*********|******|
|__________|_______|
Ingore the asterisks. They're there only for spacing purposes. )
I've tried using GridBagLayout and GridBagConstraints, but for some reason, it just plops all of the components right in the center, in an area about 25px by 25px.
Could someone give me some advice and lead me in the right direction? It is GREATLY appreciated, as I've tried all I know to do. As you can probably tell, I'm still new to JFC/Swing/AWT. Thanks again! )
[ January 04, 2003: Message edited by: Martin Clifford ]
[ January 04, 2003: Message edited by: Martin Clifford ]
[ January 04, 2003: Message edited by: Martin Clifford ]
19 years ago
Hello everyone!
I'm probably barely above beginner level, if that, but I am trying to write a program in which the user will enter some data (method unknown), and I want to store this information (at least during runtime), inside one of the many collections classes. That I can do. What I am unfamiliar with is how you go about SAVING that collection to a file, and also how you would LOAD it from the file.
I have a strong suspicion (for some reason that word looks mispelled), that it has something to do with serialization, but I am unsure right now. Does anyone have any helpful hints, or could anyone point me in the right direction to get started? Don't want solutions, just gentle nudges so I can start on the right path )
Thanks in advance!
19 years ago
I believe the output of the first given example will by 21. This is becaue you want to output the value of VALUE if the value is greater than 30 (false), OR if it is less than 40 (true). Since one is true, then the expression evaluates to true, and the value will be printed.
The second given code will have no output, since MIN is set to the value of VALUE, it can't possibly be less than VALUE. There are no else statements, so nothing can be printed, and execution would simply continue past the entire block.
The last code example would produce 24 as it's output. Be careful with switch blocks, because if there had not been a BREAK statement after the increment in the 20's case, then the output would have been 26. The switch would have dropped through to the 40's case and added another 2 to the total.
Hope this helps some, and that it's not entirely incoherent )
19 years ago
I haven't read the book, personally, but I've heard very good things about it. I suppose which book will help you the most is relative to the person (although I've heard of books out there that have information which is very misleading, and sometimes blatantly incorrect, so look out for those!).
I'm going with Mike Meyer's Exam Passport for the Java 2 Certification (Cindy Glass, Kathy Sierra, et al.), and it's very, VERY good )
HTH
appletviewer takes the argument of an HTML file which loads the applet. If you're trying to view an applet, and loading the class, it won't do anything.
Make sure that you have an appropriate HTML file that loads the applet's base class.
If your program is supposed to give output to the console window (DOS Prompt, et al.), then use Java to start the program. If it's a GUI application, then you can use Java or Javaw to start the program.
At least as far as I'm aware.
19 years ago
So even if you set the enviro var, you still have to load the driver with Class.forName() for the DriverManager, huh?
Okay, I get it now (I think). I'll keep plugging at it, but thanks for the help! )
Okay, for some reason it's working now. Here's the code that I used to make it work:

Problem now is, I have NO idea why it's working. Maybe it's because before I wasn't using Class.forName().newInstance(); at all.
Does that sound like the culprit?
Hi everyone!
Sorry to bother, but I've searched, and attempted, and failed at setting this up, and it's kind of frustrating.
Is there someone out there who might be able to tell me how to get the MySQL JDBC drivers to work? I have my classpath set to:
c:\java\bin;C:\jdbc\mysql-connector-java-2.0.14-bin.jar
This includes the java path, and also the path to MySQL Connector/J. I'm new to JDBC, obviously, but I keep getting the "No Suitable Driver" Exception.
Any and all help is GREATLY appreciated )