http://blog.163.com/yingzhuo_cao/blog/static/1751111422010102973146281/
import javax.swing.SwingUtilities;
import chrriis.common.UIUtils;
import chrriis.dj.nativeswing.swtimpl.NativeInterface;
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;
public class WebBrower {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
WebBrower webbrower=new WebBrower();
}
public WebBrower()
{
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final JFrame frame = new JFrame("");
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new EagleBrowser
("http://www.baidu.com"), BorderLayout.CENTER);
frame.setLocationByPlatform(true);
frame.setAlwaysOnTop(true);
// frame.setUndecorated(true);
frame.setSize(675,507);
// frame.setUndecorated(true);
frame.setResizable(false);
frame.addWindowListener(new WindowAdapter(){
public void windowIconified(WindowEvent e)
{
frame.setExtendedState(JFrame.ICONIFIED);
}
});
frame.setVisible(true);
}
});
NativeInterface.open();
NativeInterface.runEventPump();
}
}
class EagleBrowser extends JPanel
{
private JPanel webBrowserPanel;
private chrriis.dj.nativeswing.swtimpl.components.JWebBrowser webBrowser;
private String url;
public EagleBrowser(String url)
{
super(new BorderLayout());
this.url = url;
webBrowserPanel = new JPanel(new BorderLayout());
webBrowser = new chrriis.dj.nativeswing.swtimpl.components.JWebBrowser();
webBrowser.navigate(url);
webBrowser.setButtonBarVisible(false);
webBrowser.setMenuBarVisible(false);
webBrowser.setBarsVisible(false);
webBrowser.setStatusBarVisible(false);
webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
add(webBrowserPanel, BorderLayout.CENTER);
}
}