sparks

Greenhorn
+ Follow
since Mar 25, 2004
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 sparks

Hi all (first post)
I have created a small program that acts as a simple football league buti am having difficulty sorting the JTable where the teams are displayed.
I have two classes:
1. Input - Enters result and displays a list of results entered
2. Output - Displays a league table where team data is stored (i.e. Team name, games won/drawn/lost, goals for/against, goal difference, points)
I have some code to sort the table but am unsure if it is correct and where it should be placed. I know collections.sort(table); can be used with a bunch of if statements:
int result;
if (points > t.points) || (points == t.points) && (gd > t.gd) || (points == t.points) && (gd > t.gd) && (goalsFor > t.goalsFor)
{
result -1
}
else
{
result 1
}
return result
}
I know this needs more work but where this is to be placed is confusing.
Any help would be grateful, thanks
20 years ago