Thanks for input, here's some code:
private GameController controller
private boolean[] markedValues;
private int summa;
private int bonus;
public ScoreBoard(GameController controller)
{
super(new CardLayout());
setBorder(new EtchedBorder());
this.controller = controller;
markedValues = new boolean[19];
for(int i = 0; i<markedValues.length; i++)
markedValues[i] = false;
}
// To be called from “GameController”
public void addScoreBoardText(DicePlayer player)
{
String name = player.getName();
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(new TitledBorder(new EtchedBorder(),
name + " scoreboard"));
JTable scoreBoardText = new JTable(19, 2);
setupScoreBoardText(scoreBoardText);
panel.setBackground(Color.lightGray);
panel.add(scoreBoardText, BorderLayout.CENTER);
// L�gg texten i panelens container
CardLayout cL = (CardLayout)this.getLayout();
cL.addLayoutComponent(panel, name);
}