import javax.swing.*; import java.awt.*; class Game extends JFrame { JLabel statusBar; Game() { this.statusBar = new JLabel("Total: 0"); add(this.statusBar, BorderLayout.SOUTH); World world = new World(this.statusBar); this.getContentPane().add( world ); this.addKeyListener( world ); this.setSize(300, 600); this.setVisible(true); this.setDefaultCloseOperation(EXIT_ON_CLOSE); } public static void main(String[] args) { Game game = new Game(); } }