你好,我的问题是在下面我有一个特定类的列表,我想将这些值绑定到一个jtable(它们被添加的顺序现在不重要) 类是在列表中是folows从列表中添加值<Class>到Jtable
public HighScore(int score, int amountofplayers, String playerName,String dateString) {
this.score = score;
this.amountofplayers = amountofplayers;
this.playerName = playerName;
this.dateString = dateString;
}
返回列表中的功能是
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;
}
所以现在我想所有这些高分添加到我的Jtable1其中驻留在jpannel。最简单/最有效的方法是什么
可能重复[填充JTable使用列表](http://stackoverflow.com/questions/11095802/populate-jtable-using-list) –