⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 assistantgui.java

📁 SWT中采用继承SHELL的方法来实现主窗口调用子窗口的应用
💻 JAVA
字号:
package testshell;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

/**
 * @author lvpin
 * 2007-2-6 10:45:52
 */
public class AssistantGUI extends Shell {
	public AssistantGUI(Display display, int style) {
		 super(display, style);
         createContents();             
	}

    protected void createContents() {
        setText("AssistantGUI");
	}

	public void stop(){
        this.dispose();
	}

	protected void checkSubclass() {
        // Disable the check that prevents subclassing of SWT components
	}

	public static void main(String[] args){
		try {
			Display display = Display.getDefault();
			AssistantGUI assistGUI = new AssistantGUI(display, SWT.SHELL_TRIM);
			assistGUI.setBounds(300,300,500,375);
			
			assistGUI.open();
			assistGUI.layout();
            while (!assistGUI.isDisposed()) {
         	   if (!display.readAndDispatch())
         		   display.sleep();
            }
		} catch (Exception e) {
        	e.printStackTrace();
        }
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -