Clare Wright

Greenhorn
+ Follow
since Jun 06, 2006
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 Clare Wright

Oops sorry about that Marc, got married hence the profile change. Thank you both so much for the help, I'm getting it now!
17 years ago
Hi,

I'm struggling a bit with the reasons for method overloading, I understand why one would override a method but not overload it. Could be a stupid question...

Thanks
Cynth :roll:
17 years ago
Yeehah! Awesome - thanks so much, I just got it working. You guys are the best.
17 years ago
Hi!

Hoping someone can point me in the right direction.

I have a Person class with comparators for each attribute of the person, so that I can sort according to the different attributes such as name, surname, age. At the moment when I type java TestPerson.java - it�s printing out something like:

Firstname sort:

Susan, Smith 25
Tom, Robbins 42

I now want to include in my command line argument the attribute and the type of sort Eg. TestPerson.java surname ascend. Are there any tutorials that would explain to me how programs take in command-line arguments?

Thanks, hugely appreciated.
17 years ago
Yes I'm starting to get that - feeling a lot better - this Big Moose Saloon really is a friendly place for beginners. Thanks!
17 years ago
Yip! You were exactly correct!
17 years ago
Found the problem. Ingeniously I had another Panel.java file in the directory - bad move I have learnt from this mistake.
17 years ago
Howdy,

Would appreciate some help on the code below. I thought this error was brought on by missing braces etc - the compiler doesn't seem to like the Panel center = new Panel(); line. By importing java.applet.Applet I thought it would work fine.

import java.awt.*;
import java.applet.Applet;

public class NestedPanels extends Applet {
public NestedPanels () {
Panel center = new Panel(); //error happening here
// error is: 'class' or 'interface' expected Panel panel = new Panel();

center.setLayout(new BorderLayout());
center.add("South", new Button("south"));
center.add("North", new Button("north"));
center.add("East", new Button("east"));
center.add("West", new Button("west"));
center.add("Center", new Button("center"));

Panel south = new Panel();
south.setLayout(new FlowLayout());
south.add(new Button("Help"));
choice = new Choice();
choice.addItem("one");
choice.addItem("two");
choice.addItem("three");
choice.addItem("four");
choice.addItem("five");
south.add(choice);
messageBar = new Label("This is a message bar.");
south.add(messageBar);

setLayout(new BorderLayout());
add("North", new Button("North"));
add("East", new Button("East"));
add("West", new Button("West"));
add("South", south);
add("Center", center);

}

protected Label messageBar;
protected Choice choice;
}


Thanks.
17 years ago
thanks Jesper. My textbook seems to be dealing with GUIs at the very end I think if they were introduced first it might have made things clearer. But who am I to judge I'm a baby greenhorn.
17 years ago
much appreciated. now i can move ahead!
17 years ago
Hi,

Very new to java so sorry if this sounds stupid. Doing some exercises - if the question says Design and Implement a class, do you create a ClassName.java file in which your class is designed and implemented? I remember doing C++ where the class definition was a separate file and the implementation in another file.

Thanks.
17 years ago