Esempio n. 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();
     }
   }
 }
Esempio n. 2
0
 private void uglyjoglhack() throws InterruptedException {
   try {
     display();
   } catch (RuntimeException e) {
     if (e.getCause() instanceof InterruptedException) {
       throw ((InterruptedException) e.getCause());
     } else {
       throw (e);
     }
   }
 }
  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);
  }