Beispiel #1
0
 protected void fireChangeListeners() {
   if (changeListeners == null) return;
   for (int a = 0; a < changeListeners.size(); a++) {
     ChangeListener l = (ChangeListener) changeListeners.get(a);
     try {
       l.stateChanged(new ChangeEvent(this));
     } catch (RuntimeException e) {
       e.printStackTrace();
     }
   }
 }
  private void init() {
    soundPlayer = new SoundPlayer();
    soundPlayer.startBackgroundMusic();

    try {
      emptyCursor =
          Toolkit.getDefaultToolkit()
              .createCustomCursor(
                  new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB), new Point(0, 0), "empty");
    } catch (RuntimeException e) {
      e.printStackTrace();
    }
    setFocusTraversalKeysEnabled(false);
    requestFocus();

    // hide cursor, since we're drawing our own one
    setCursor(emptyCursor);
  }