Пример #1
0
  App() {
    game = new Game();
    view = new View(game, game.getImage());
    controlPanel = new ControlPanel(view, game);

    setTitle("Zap 'em");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    add(view, BorderLayout.CENTER);
    add(controlPanel, BorderLayout.SOUTH);

    Dimension dimension =
        new Dimension(Game.IMAGE_SIZE, Game.IMAGE_SIZE + controlPanel.getHeight());
    setSize(dimension);
    setPreferredSize(dimension);
    setVisible(true);
  }