在AWT /摆动最佳组件来显示网页和访问 [英] Best component in awt/swings to display the webpage and access it

查看:428
本文介绍了在AWT /摆动最佳组件来显示网页和访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是AWT最好的组件/摇来显示网页,访问的网页中的组件,而不会像(正常的JavaScript中的任何问题,在页面图像应显示良好,如在浏览器和支持的浏览器查看网页与所有功能)
这里有一个关于它显示网页教程,但它说,我们cannt保​​证JEditotPane将提供尽可能的浏览器。

Which is the best component in awt/Swings to display the webpage and access the webpage in that component without any issues like (functioning of javascript, images in the page should display good, as viewing the page on browser and support as browser with all functionalities) here there is a tutorial about it displaying webpage but it says,we cannt assure JEditotPane will provide as browser.

您可以在教程的最后一段看到的。
我需要实现的是,在AWT /波动显示网页。我试过例如,在该链接,但得到的消息:请启用javascript,以显示

You can see in the last paragraph of that tutorial. I need to implement that, webpage to be displayed in awt/swings. I tried the example in that link, but got message: "Please enable javascript to display".

所以,任何人都可以请指导我,就显示秋千/ AWT或任何替代网页的最佳方法。

So can anyone please guide me, regarding the best approach to display webpage on swings/awt or any alternative for that.

更新:

Update :

我已经下载了Jbrowser的罐子,并试图这是那里Jbrowser网站的一个例子。但得到例外的下面。

I have downloaded the jars for Jbrowser and tried one example which was there in Jbrowser site. But getting below exception.

        import java.awt.Canvas;  
    import java.awt.Dimension;  
    import java.awt.Toolkit;  
    import javax.swing.JFrame;    
    import ru.atomation.jbrowser.impl.JBrowserComponent;  
    import ru.atomation.jbrowser.impl.JBrowserBuilder;  
    import ru.atomation.jbrowser.impl.JBrowserCanvas;  
    import ru.atomation.jbrowser.impl.JComponentFactory;  
    import ru.atomation.jbrowser.interfaces.BrowserManager;
public class GettingStartedSnippet {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize((int) (screenSize.getWidth() * 0.75f),
                (int) (screenSize.getHeight() * 0.75f));
        frame.setLocationRelativeTo(null);
        BrowserManager browserManager =   new JBrowserBuilder().buildBrowserManager();
        JComponentFactory<Canvas> canvasFactory = browserManager.getComponentFactory(JBrowserCanvas.class);
        JBrowserComponent<?> browser = canvasFactory.createBrowser();                    
        frame.getContentPane().add(browser.getComponent());          
        frame.setVisible(true);            
        browser.setUrl("http://code.google.com/p/jbrowser/");  

    }

}

这是我发现的例子<一个链接href=\"http://$c$c.google.com/p/jbrowser/source/browse/src/main/java/ru/atomation/jbrowser/snippets/GettingStartedSnippet.java?repo=snippets\"相对=nofollow> GettingStartedSnippet

例外:

Exception :

Apr 18, 2012 3:42:11 PM ru.atomation.jbrowser.impl.JBrowserBuilder getXulRunnerPath
INFO: Unpacking mozilla to: D:\WorkSpaces\example\example\jbrowser
Apr 18, 2012 3:42:11 PM ru.atomation.xulnative.XulExtractor extract
SEVERE: Xulrunner archive not found in jar
Apr 18, 2012 3:42:11 PM ru.atomation.jbrowser.impl.JBrowserManager initialize
SEVERE: invalid current xulrunner location D:\WorkSpaces\example\example\jbrowser\xulrunner\xulrunner
Apr 18, 2012 3:42:11 PM ru.atomation.jbrowser.impl.JBrowserManager initialize
INFO: Continuing to search for other xulrunners
Apr 18, 2012 3:42:11 PM ru.atomation.jbrowser.impl.JBrowserManager initialize
SEVERE: failed to initialize mozilla
Throwable occurred: java.io.IOException: Unable to resolve XULRunner home location
    at ru.atomation.jbrowser.impl.JBrowserManager.initialize(JBrowserManager.java:118)
    at ru.atomation.jbrowser.impl.JBrowserManager.<init>(JBrowserManager.java:67)
    at ru.atomation.jbrowser.impl.JBrowserBuilder.buildBrowserManager(JBrowserBuilder.java:127)
    at GettingStartedSnippet.main(GettingStartedSnippet.java:23)

我browsered找到解决办法,我无法获得该问题贴切的解决方案。请任何人都可以向我提供的解决方案。

I browsered to find the solution, i could not get apt solution for the issue. Please can anyone provide me solution.

推荐答案

Jbrowser 用于xullrunner形式Mozilla项目,所以jbrowser是Firefox浏览器的包装。

Jbrowser is used xullrunner form mozilla project, so jbrowser is wrapper for firefox browser.

有关我的问题,我用 NativeSwing库,最好是组分i feel.with这个我实现整合网页这在非HTML页面Swing应用程序。

For my issue i used NativeSwing library , it is best component i feel.with this i implemented integrating webpage which is non html page in to Swing application.

这篇关于在AWT /摆动最佳组件来显示网页和访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆