import javax.swing.*; class Game extends JFrame { Game() { World world = new World(); this.add(world); this.addKeyListener( world ); this.setVisible(true); this.setSize(200, 400); this.setDefaultCloseOperation(EXIT_ON_CLOSE); world.start(); } public static void main(String[] args) { Game game = new Game(); } }