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(); }
public Main(GameBoard panel) { super(new BorderLayout()); panel.addMouseListener(this); this.addMouseListener(this); }