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

📄 nativewebbrowser.java

📁 一款即时通讯软件
💻 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 + -