public boolean handleEvent (Event event) {
    if (event.id == Event.WINDOW_DESTROY)
      quit();
    else if (event.target == scrollbar) {
      int[] view = waveCanvas.getView();
      int l = view[1] - view[0];
      boolean flag = true;

      // Bloody Win32 AWT.  Hurry up with that rewrite, Sun!
      // This also doesn't work with Netscape under Win32... neither does
      if (event.id == Event.SCROLL_LINE_DOWN) view[0] += l / 16;
      else if (event.id == Event.SCROLL_LINE_UP) view[0] -= l / 16;
      else if (event.id == Event.SCROLL_PAGE_DOWN) view[0] += l * 3 / 4;
      else if (event.id == Event.SCROLL_PAGE_UP) view[0] -= l * 3 / 4;
      else if (event.id == Event.SCROLL_ABSOLUTE) 
        view[0] = ((Integer)event.arg).intValue();
      else flag = false;
      
      if (flag) {
        view[1] = view[0] + l;
        waveCanvas.setView (view[0], view[1]);
        updateScrollbar();
      }
    }
    else return super.handleEvent (event);
    return true;
  }