1. 程式人生 > >Eclipse二次開發:開啟web 瀏覽器

Eclipse二次開發:開啟web 瀏覽器

		try {
			IWorkbenchBrowserSupport workbenchBrowserSupport = PlatformUI.getWorkbench().getBrowserSupport();
			IWebBrowser webBrowser = workbenchBrowserSupport.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR, "org.eclipse.ui.defaultBrowser", "name", "tooltip");
			if (webBrowser != null) {
				webBrowser.openURL(new URL("https://www.csdn.net/"));
			}
		} catch (Exception e) {
		}