Nigel Crowhurst

Greenhorn
+ Follow
since Nov 11, 2005
Merit badge: grant badges
For More
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 Nigel Crowhurst

Thanks Michael!
You were right! Mercy. The instructor for my Java class at school said to just take that class out and KISS my program assignment, and didn't know how to fix it. And here you fixed it with one sentence. I moved setVisible(true); to the bottom of the inner class and it works great! What threw me was that the instructor has us students putting "main" in a different class in a separate file. So all "main" does is declare a new object of that class, setDefaultCloseOperation(), setSize(), and setVisible(true). So it looked to me like setVisible() could go right after the class was declared, so I did the same thing for the inner class. Now I know better. So in main, the object is declared, it goes out and sets up all the JButtons, JLabels, etc. in the other file, and comes back to main to setSize, setVisible, etc. I hope that's right. Thanks for saving my project.

Very kindly,
Nigel
18 years ago
- Hello Marc,
Thank you so much for moving this to the Swing forum. I have a lot to learn about JavaRanch.com, and way way more about Java itself. I'm anxious to do this so I can be in a spot to where I can help others. This really helped me out, and I really appreciate it.

Very kindly,
Nigel
18 years ago
Greetings, within a JFrame I have a few JButtons, a few JLabels, and a JTextField. One of the JButtons opens a new window (JFrame). An anonymous actionPerformed inner class calls another JFrame object within the existing object. The inner JFrame object opens a new window like it should. However the window is blank. The two JLabels, two JButtons, and two JLists are not visible until... this is the tricky part, I click on any of the four edges of the window frame. Then the components are in view and the whole thing works properly. The program compiles and the setLayout, setSize, setVisible, etc. are identical to outer JFrame that opens fine when the program is started. I've tried everything I can think of, and was hoping someone else has seen this phenomenon before. Many thanks.
18 years ago
My sincere apologies. Within a half second I noticed your name is spelt Bert. I�m truly sorry.

Kindly,
NBC
18 years ago
Greetings Burt,
I am enjoying the book very much, and I'm Still chuckling over the caption for the photo on page 80. I�m doing both; typing in the code to see the output, and looking at the code to try and understand how it�s working with pencil and paper. I do fairly well when tracking variables like �counter� and �x�, when they get used and incremented, but it got a little hazy for the �maybeNew� part. I got it into my thick head that �Mix4 m4 = new Mix4 ( );� was a new object and not a new array. But the �counter + 1� for m4 and �return 1� threw me off. I�m not clear on how two �counters� being incremented is affecting the program, on where �return 1� is returned to, and I need to refresh my memory on what the println is concatenating with the � �.

On page 83 can the statements in step 1 be combined as �Dog [ ] pets = new Dog [ 7 ];�? If so, would making them separate allow for a better programming practice? Just curious. I like the Code Magnets and matching type exercises, but the Pool Puzzles I find quite challenging with all the choices. I�ll keep trying, as it�s just my old age gettin in the way.

Thank you so much for providing an excellent recommendation. Putting System.out.println() statements in the program to print out variables is just the ticket I needed, and I can�t wait to try it out. I sincerely appreciate you taking the time to reply to me. I need all the help I can get, since these 8-week courses at this college are brutal, and some feel Java should be split into two classes. I think it should only be taught in 16-week classes at state colleges myself, but what do I know.

Many thanks & kind regards,
Nigel
18 years ago
I'm reading Head First Java 2e to try and pass my first Java class at school. It's an 8-week course and they went from writing "Hello World" to the screen on the first day, to a 13 file (class) packaged program that was due the second week. I'm lost, and it's been 13 years since I had C++ OOP. The exercise code on page 90 of Head First Java has me confused and there's only answers, not explanations. Could someone perhaps explain how "maybeNew", "index", "return 1", etc. work with the while loop to get the "Possible outputs" they have listed? I'm brand new to online discussion groups, and this very message is my first attempt to not look more stupid than I am. Many Thanks.

Very kindly,
Nigel
18 years ago