📄 controllistenerexample.java
字号:
package com.free.event;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* <p>Title: Eclipse Plugin Development</p>
* <p>Description: Free download</p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: Free</p>
* @author gan.shu.man
* @version 1.0
*/
public class ControlListenerExample {
/**
* Runs the application
*/
public void run() {
Display display = new Display();
Shell shell = new Shell(display);
shell.addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
// TODO Auto-generated method stub
System.out.println("control move");
}
public void controlResized(ControlEvent e) {
// TODO Auto-generated method stub
System.out.println("control resize");
}
}
);
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
/**
* Application entry point
*
* @param args the command line arguments
*/
public static void main(String[] args) {
new ControlListenerExample().run();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -