Exemplo n.º 1
0
 private static void createAndShowGui(GameBoard view) {
   final JFrame frame = new JFrame("Bully And The Bots");
   JComponent panel = new Main(view);
   panel.add(view, BorderLayout.CENTER);
   view.setFocusable(true);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.setContentPane(panel);
   frame.setPreferredSize(new Dimension(Config.WIDTH + 20, Config.HEIGHT + 94));
   frame.setSize(Config.WIDTH + 20, Config.HEIGHT + 94);
   frame.pack();
   frame.setLocation(10, 10);
   frame.setVisible(true);
   Rectangle r = frame.getBounds();
 }
Exemplo n.º 2
0
 public Main(GameBoard panel) {
   super(new BorderLayout());
   panel.addMouseListener(this);
   this.addMouseListener(this);
 }