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

📄 ch08_06.java

📁 learn to use eclipse by example
💻 JAVA
字号:
package org.eclipsebook.ch08;

import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.ole.win32.*;

public class Ch08_06 {

	public static void main(String[] args) {
		
		final Display display = new Display();
		Shell shell = new Shell(display);
		shell.setSize(600, 400);
		shell.setLayout(new FillLayout());
		
		OleControlSite oleControlSite;
		
		OleFrame oleFrame = new OleFrame(shell, SWT.NONE);
		oleControlSite = new OleControlSite(oleFrame, SWT.NONE, "Shell.Explorer");
		oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
		shell.open();
		
		final OleAutomation browser = new OleAutomation(oleControlSite);
	
		int[] browserIDs = browser.getIDsOfNames(new String[]{"Navigate", "URL"}); 
		Variant[] address = new Variant[] {new Variant("http://www.oreilly.com")};
		browser.invoke(browserIDs[0], address, new int[]{browserIDs[1]});
			
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	
		browser.dispose();
		display.dispose();
	}
}

⌨️ 快捷键说明

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