Example #1
0
  // init also call init from superclass
  public void init() {
    super.init();

    Window w = s.getFullScreenWindow();
    w.setFocusTraversalKeysEnabled(false); // just be a tab button, not just jump to next form
    w.addKeyListener(this);

    mess = "Press escape to exit";
  }
Example #2
0
  // init
  public void init() {
    super.init();
    mouse = new Point();
    center = new Point();
    image = new Point();
    centering = false;

    try {
      robot = new Robot();
      recenterMouse();
      mouse.x = center.x;
      mouse.y = center.y;
    } catch (Exception e) {
      System.out.println("Exception 1");
    }

    Window w = s.getFullScreenWindow();
    w.addMouseMotionListener(this);
    w.addKeyListener(this);
    bg = new ImageIcon("/Users/Ole/Desktop/undefined/images/bg.jpg").getImage();
  }