示例#1
0
文件: Main.java 项目: JoeDog/bots
 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();
 }
示例#2
0
文件: Main.java 项目: JoeDog/bots
 public Main(GameBoard panel) {
   super(new BorderLayout());
   panel.addMouseListener(this);
   this.addMouseListener(this);
 }