📄 nativewebbrowser.java
字号:
package edu.ou.kmi.buddyspace.utils;
import javax.swing.JOptionPane;
public class NativeWebBrowser {
/** Goes to given URL - works only under Windows - opens external web browser. */
static public void launchURL(String url) {
try {
if (OSVersion.isWindowsNTPlatform()) {
String command = new String("cmd.exe /c start \"BuddySpace - browsing link\" \"" + url + "\"");
//System.out.println(command);
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
}
else if (OSVersion.isWindows9xPlatform()) {
String command = new String("command.com /c start \"" + url + "\"");
//System.out.println(command);
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
}
else
System.out.println("Sorry, no web browsing support for nonWin yet");
//htmlEditorPane.setPage(url);
} catch (Exception e) {
//System.out.println("Couldn't load the url: " + e.getMessage());
JOptionPane.showMessageDialog(null,
"Cannot open url " + url,
"Web browser error",
JOptionPane.ERROR_MESSAGE);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -