Hello my problem is the foloowing i have a List of a certain class of which i want to bind the values to a jtable (order in which they are added isnt important right now) The class that is in the list is as folows
public HighScore(int score, int amountofplayers, String playerName,String dateString) {
this.score = score;
this.amountofplayers = amountofplayers;
this.playerName = playerName;
this.dateString = dateString;
}
the function that returns the list is
public ArrayList<HighScore> GetHighScores()
{
ArrayList<HighScore> highscores = new ArrayList<HighScore>();
//get highscores from databse
//insert some test values
highscores.add(new HighScore(125, 2, "Piet","20-10-2015"));
highscores.add(new HighScore(167, 2, "Henk", "19-10-2015"));
highscores.add(new HighScore(278, 2, "Jan", "11-10-2015"));
return highscores;
}
So now i want to add all these highscores to my Jtable1 in which resides in a jpannel. What would be the easiest/most effiecient way to do this