Beispiel #1
0
 /**
  * You can ignore this method. This method gets called by the subclass's constructor when it has
  * finished initializing, but that call is already written in <code>MyGame.java</code>.
  */
 protected void ready() {
   if (applet) {
     add(canvas);
   } else {
     frame.add(canvas);
     frame.pack();
     frame.setLocationRelativeTo(null);
     frame.setResizable(false);
     frame.setVisible(true);
   }
 }
Beispiel #2
0
  public static void main(String args[]) {
    Component comp = new Component();
    System.out.println("Mineblock Development Console: ");
    System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
    System.out.println("Current Version: " + versionNumber);
    frame = new JFrame();
    frame.add(comp);
    frame.pack();

    realSize = new Dimension(frame.getWidth(), frame.getHeight());

    frame.setTitle(name + versionNumber);
    frame.setResizable(true);
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    comp.start();
  }