The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Simple sorting program, can't figure out whats wrong with my code

Program description:

The purpose of this assignment is to give you experience in both Java, as well as in the design of algorithms for sorting different kinds of data. The system you will construct will consist of a window that contains a title, a table with two columns, and two buttons, as shown here. The first column of the table will contain the names of people and the second column will contain their corresponding ages. The table will initially be empty and a user will be able to type values into it. One button will cause the entries in the table to be sorted based on the name in column 1 and the second button will cause the entries to be sorted based on the ages in column 2.

my code:
//Class that only contains name and age variables
public class Person {

Re: Simple sorting program, can't figure out whats wrong with my code

Please use the highlight tags when posting code.

Also, you've posted a bunch of code and your assignment, but no explanation of what's going on or what your question is. What do you expect this code to do? What does it do instead? What line exhibits the incorrect behavior? Have you stepped through this with a debugger to figure out what's going on?