1 20 21 package org.jdesktop.jdic.desktop.internal.impl; 22 23 import java.net.URL ; 24 25 import org.jdesktop.jdic.desktop.internal.BrowserService; 26 import org.jdesktop.jdic.desktop.internal.LaunchFailedException; 27 28 33 public class MacBrowserService implements BrowserService { 34 static { 35 System.loadLibrary("jdic"); 36 } 37 38 45 public void show(URL url) throws LaunchFailedException { 46 if (!nativeBrowseURL(url.toString())) { 47 throw new LaunchFailedException( 48 "Failed to launch the default browser."); 49 } 50 } 51 52 public void show(URL url, String target) throws LaunchFailedException { 53 show(url); 54 } 55 56 private native boolean nativeBrowseURL(String urlStr); 57 } 58 | Popular Tags |