01: package com.dwipal;
02:
03: import java.awt.*;
04:
05: /** This class implements the "DoEvents" function, which allows
06: * the event queue to perform its events.
07: */
08:
09: public class DwEvtQueue extends java.awt.EventQueue {
10:
11: /** Create a new instance of the class
12: */
13: public DwEvtQueue() {
14: }
15:
16: /** execute the event queue
17: */
18: public void doEvents() {
19: Toolkit toolKit = Toolkit.getDefaultToolkit();
20: EventQueue evtQueue = toolKit.getSystemEventQueue();
21:
22: // loop whilst there are events to process
23: while (evtQueue.peekEvent() != null) {
24: try {
25: // if there are then get the event
26: AWTEvent evt = evtQueue.getNextEvent();
27: // and dispatch it
28: super .dispatchEvent(evt);
29: } catch (java.lang.InterruptedException e) {
30: // if we get an exception in getNextEvent()
31: // do nothing
32: ;
33: }
34: }
35: }
36: }
|