本文整理汇总了Java中chrriis.dj.nativeswing.swtimpl.components.JWebBrowser类的典型用法代码示例。如果您正苦于以下问题:Java JWebBrowser类的具体用法?Java JWebBrowser怎么用?Java JWebBrowser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JWebBrowser类属于chrriis.dj.nativeswing.swtimpl.components包,在下文中一共展示了JWebBrowser类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WebBrowser
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; //导入依赖的package包/类
public WebBrowser() {
super(new BorderLayout());
JPanel webBrowserPanel = new JPanel(new BorderLayout());
webBrowserPanel.setBorder(BorderFactory
.createTitledBorder("Native Web Browser component"));
webBrowser = new JWebBrowser();
webBrowser.navigate("http://www.google.com");
webBrowser.setMenuBarVisible(false);
webBrowserPanel.add(webBrowser, BorderLayout.CENTER);
add(webBrowserPanel, BorderLayout.CENTER);
// // Create an additional bar allowing to show/hide the menu bar of the
// web browser.
// JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 4,
// 4));
// JCheckBox menuBarCheckBox = new JCheckBox("Menu Bar",
// webBrowser.isMenuBarVisible());
// menuBarCheckBox.addItemListener(new ItemListener() {
// public void itemStateChanged(ItemEvent e) {
// webBrowser.setMenuBarVisible(e.getStateChange() ==
// ItemEvent.SELECTED);
// }
// });
// buttonPanel.add(menuBarCheckBox);
// add(buttonPanel, BorderLayout.SOUTH);
}
示例2: FileSourceViewerPanel
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; //导入依赖的package包/类
/** Creates new form FileSourceViewerPanel */
public FileSourceViewerPanel(SourceViewerDialog dialog, final Item item) {
this.initComponents();
this.searchViewerDialog = dialog;
this.keyword = dialog.getQueryString();
this.item = item;
// add file browser
this.fileBrowser = new JWebBrowser();
this.fileBrowser.setBarsVisible(false);
this.fileBrowser.setStatusBarVisible(false);
this.fileRenderPanel.add(fileBrowser, BorderLayout.CENTER);
this.displayDocumentInformation();
}
示例3: EmailSourceViewerPanel
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; //导入依赖的package包/类
/** Creates new form EmailSourceViewerPanel */
public EmailSourceViewerPanel(SourceViewerDialog dialog, final Item item) {
initComponents();
this.dialog = dialog;
this.keyword = dialog.getQueryString();
this.item = item;
// add file browser
this.emailContentBrowser = new JWebBrowser();
this.emailContentBrowser.setBarsVisible(false);
this.emailContentBrowser.setStatusBarVisible(false);
this.messagePanel.add(emailContentBrowser, BorderLayout.CENTER);
this.displayDocumentInformation();
}
示例4: updateResult
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; //导入依赖的package包/类
private void updateResult(TestCase testCase, WebClient webClient,
HtmlPage page) {
if (page != null) {
HtmlHead head = (HtmlHead) page.getElementsByTagName("head").get(0);
HtmlElement base = head.appendChildIfNoneExists("base");
base.setAttribute("href", page.getUrl().toString());
head.removeChild(base);
head.insertBefore(base);
testCase.setResultPageText(page.asText());
testCase.setResultPageHTML(page.asXml());
testCase.setResultURL(page.getUrl());
for (Cookie cookie : webClient.getCookieManager().getCookies()) {
JWebBrowser.setCookie(page.getUrl().toString(), cookie
.toString());
}
}
webClient.closeAllWindows();
webClient.getCookieManager().clearCookies();
webClient.getCache().clear();
}
示例5: createCustomWebBrowserDecorator
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; //导入依赖的package包/类
private WebBrowserDecorator createCustomWebBrowserDecorator(JWebBrowser webBrowser, Component renderingComponent) {
// Let's extend the default decorator.
// We could rewrite our own decorator, but this is far more complex and we generally do not need this.
return new DefaultWebBrowserDecorator(webBrowser, renderingComponent) {
@Override
protected void addMenuBarComponents(DefaultWebBrowserDecorator.WebBrowserMenuBar menuBar) {
// We let the default menus to be added and then we add ours.
super.addMenuBarComponents(menuBar);
JMenu myMenu = new JMenu("[[My Custom Menu]]");
myMenu.add(new JMenuItem("My Custom Item 1"));
myMenu.add(new JMenuItem("My Custom Item 2"));
menuBar.add(myMenu);
}
@Override
protected void addButtonBarComponents(DefaultWebBrowserDecorator.WebBrowserButtonBar buttonBar) {
// We completely override this method so we decide which buttons to add
buttonBar.add(buttonBar.getBackButton());
final JButton button = new JButton("[[My Custom Button!]]");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(button, "My Custom Button was pressed!");
}
});
buttonBar.add(button);
buttonBar.add(buttonBar.getForwardButton());
buttonBar.add(buttonBar.getReloadButton());
buttonBar.add(buttonBar.getStopButton());
}
};
}
示例6: createTabBrowserWithClose
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; //导入依赖的package包/类
private static void createTabBrowserWithClose(int index,JWebBrowser brows,String title,boolean hideClose,Color color){
tabbedPane.addTab(title, brows);
TabPanel pnlTab= new TabPanel(title,hideClose,color);
tabbedPane.setTabComponentAt(index, pnlTab);
pnlTab.getBtnClose().addActionListener(new TabCloseActionHandler(brows, index));
}
示例7: TabCloseActionHandler
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; //导入依赖的package包/类
public TabCloseActionHandler(JWebBrowser brows, int index) {
this.brows = brows;
this.index = index;
}