dwevtqueue.java
来自「用JAVA实现的MIB浏览器」· Java 代码 · 共 42 行
JAVA
42 行
package com.dwipal;
import java.awt.*;
/** This class implements the "DoEvents" function, which allows
* the event queue to perform its events.
*/
public class DwEvtQueue extends java.awt.EventQueue {
/** Create a new instance of the class
*/
public DwEvtQueue() {
}
/** execute the event queue
*/
public void doEvents()
{
Toolkit toolKit = Toolkit.getDefaultToolkit();
EventQueue evtQueue = toolKit.getSystemEventQueue();
// loop whilst there are events to process
while (evtQueue.peekEvent() != null)
{
try
{
// if there are then get the event
AWTEvent evt = evtQueue.getNextEvent();
// and dispatch it
super.dispatchEvent(evt);
}
catch (java.lang.InterruptedException e)
{
// if we get an exception in getNextEvent()
// do nothing
;
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?