public void sendEvent(int id){
synchronized (this) {
    if (queue == null) {
      queue=new Queue();
    }
    Integer eventId=Integer.valueOf(id);
    queue.enqueue(eventId);
    notifyAll();
  }
  if (id == APPLET_QUIT) {
    try {
      joinAppletThread();
    }
 catch (    InterruptedException e) {
    }
    if (loader == null)     loader=getClassLoader(getCodeBase(),getClassLoaderCacheKey());
    release();
  }
}

public void sendEvent ( int id ) { synchronized ( this ) { if ( queue == null ) { queue = new Queue ( ) ; } Integer eventId = Integer . valueOf ( id ) ; queue . enqueue ( eventId ) ; notifyAll ( ) ; } if ( id == APPLET_QUIT ) { try { joinAppletThread ( ) ; } catch ( InterruptedException e ) { } if ( loader == null ) loader = getClassLoader ( getCodeBase ( ) , getClassLoaderCacheKey ( ) ) ; release ( ) ; } }
send an event . queue it for execution by the handler thread .
