public void prevStep() { game.prevStep(); mainPanel.remove(boardPanel); boardPanel.removeAll(); boardPanel.add(new JLabel(game.outputText()), BorderLayout.NORTH); boardPanel.add(new JLabel(game.outputBoard()), BorderLayout.CENTER); mainPanel.add(boardPanel); repaint(); printAll(getGraphics()); }
private void buildScreen() { boardPanel.add(new JLabel(game.outputText()), BorderLayout.NORTH); boardPanel.add(new JLabel(game.outputBoard()), BorderLayout.CENTER); mainPanel.add(boardPanel, BorderLayout.CENTER); add(mainPanel); setVisible(true); }