@Override public void stateMachineMetaGame(long timeout) throws TransitionDefinitionException, MoveDefinitionException, GoalDefinitionException { if (theCanvas == null) System.err.println("KioskGamer did not receive a canvas."); theCanvas.setStateMachine(getStateMachine()); theGUI = new GameGUI(theCanvas); theGUI.setRole(getRole()); theGUI.setBackground(theGUIPanel.getBackground()); theGUI.updateGameState(getStateMachine().getInitialState()); theGUI.addObserver(this); theGUIPanel.removeAll(); theGUIPanel.add("Center", theGUI); theGUIPanel.repaint(); theGUIPanel.setVisible(false); theGUIPanel.setVisible(true); theGUIPanel.validate(); theGUIPanel.repaint(); }