code: public Object[] toArray() {
  		XEvent array[] = new XEvent[events.size()];
  		for (int i = 0; i < events.size(); i++) {
  			try {
  				array[i] = events.get(i);
  			} catch (IOException e) {
  				e.printStackTrace();
  			}
  		}
  		return array;
  	}
docs: /*
  (non-Javadoc)
  
  @see java.util.List#toArray()