在DJ Native Browser中

时间:2015-05-09 05:34:40

标签: java windows swing swt djnativeswing

我想全屏运行你在Swing Native浏览管视频,但是我 我无法逃跑。我没有任何例外。在我的家乡 浏览器屏幕只有黑色十字按钮显示在顶部 我的jFarme的左角。在我的32位Windows机器上工作 文件。但是当我在64位Windows机器上试用它时它无法正常工作。 如果您对我的问题有所了解,请帮助我

我使用的是:

DJNativeSwing.jarDJNativeSwing-SWT.jarorg.eclipse.swt.win32.win32.x86_64-4.3.jar

试用网址

https://www.youtube.com/v/hk5IMmEDWH4

https://www.youtube.com/v/b-cr0ewwatk?fs=1

代码

public static void main(String[] args) {
    NativeInterface.open();
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new JFrame("YouTube Viewer");
            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            frame.getContentPane().add(getBrowserPanel(), BorderLayout.CENTER);
            frame.setSize(1024, 800);
            frame.setLocationByPlatform(true);
            frame.setVisible(true);
        }
    });
    NativeInterface.runEventPump();
    // don't forget to properly close native components
    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
        @Override
        public void run() {
            NativeInterface.close();
        }
    }));
}

public static JPanel getBrowserPanel() {
    JPanel webBrowserPanel = new JPanel(new BorderLayout());
    JWebBrowser webBrowser = new JWebBrowser();
    webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
    webBrowser.setBarsVisible(false);
    webBrowser.navigate(URL);
    return webBrowserPanel;
}

0 个答案:

没有答案
相关问题