package studio.Browser;
/*
* Copyright (C) 2004 Sun Microsystems, Inc. All rights reserved. Use is
* subject to license terms.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the Lesser GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.SwingConstants;
import java.io.File;
import java.net.URL;
import java.net.MalformedURLException;
import org.jdesktop.jdic.browser.*;
/**
* JDIC API demo main class.
* <p>
* <code>Browser</code> is a GUI application demonstrating the usage of the JDIC API package
* <code>org.jdesktop.jdic.browser</code> (Browser component).
*/
public class Browser extends JPanel {
static
{
BrowserEngineManager engineManager = BrowserEngineManager
.instance();
engineManager.setActiveEngine(BrowserEngineManager.IE);
}
/* public static ImageIcon browseIcon = new ImageIcon(
Thread.currentThread().getContextClassLoader().getResource("images/right.gif"));*/
// E:\myWork\TomcatServerMonitor\images\right.gif
BorderLayout borderLayout1 = new BorderLayout();
public static ImageIcon browseIcon = new ImageIcon(
Thread.currentThread().getContextClassLoader().getResource("images/right.gif"));
JToolBar jBrowserToolBar = new JToolBar();
JButton jStopButton = new JButton("停止",
new ImageIcon(Thread.currentThread().getContextClassLoader().getResource("images/stop.png")));
static JButton jRefreshButton = new JButton("刷新",
new ImageIcon(Thread.currentThread().getContextClassLoader().getResource("images/reload.png")));
JButton jForwardButton = new JButton("前进",
new ImageIcon(Thread.currentThread().getContextClassLoader().getResource("images/forward.png")));
JButton jBackButton = new JButton("后退",
new ImageIcon(Thread.currentThread().getContextClassLoader().getResource("images/back.png")));
JPanel jAddressPanel = new JPanel();
JLabel jAddressLabel = new JLabel();
JTextField jAddressTextField = new JTextField();
public static JButton jGoButton = new JButton();
JPanel jAddrToolBarPanel = new JPanel();
MyStatusBar statusBar = new MyStatusBar();
JPanel jBrowserPanel = new JPanel();
static WebBrowser webBrowser;
public Browser() {
try {
jbInit();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws InterruptedException, MalformedURLException {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {}
JFrame frame = new JFrame("JDIC API Demo - Browser");
Container contentPane = frame.getContentPane();
contentPane.setLayout(new GridLayout(1, 1));
contentPane.add(new Browser());
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.pack();
frame.setVisible(true);
int a=0;
while(a<1000)
{
a++;
/*Thread.sleep((long)4000);
jRefreshButton.doClick();*/
Thread.sleep((long)4000);
jGoButton.doClick();
}
}
private void jbInit() throws Exception {
this.setLayout(borderLayout1);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.setPreferredSize(new Dimension(screenSize.width * 9 / 10,
screenSize.height * 8 / 10));
ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
jAddressLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
jAddressLabel.setToolTipText("");
jAddressLabel.setText(" 地址: ");
jGoButton.setBorder(BorderFactory.createCompoundBorder(new EmptyBorder(0,
2, 0, 2),
new EtchedBorder()));
jGoButton.setMaximumSize(new Dimension(60, 25));
jGoButton.setMinimumSize(new Dimension(60, 25));
jGoButton.setPreferredSize(new Dimension(60, 25));
jGoButton.setToolTipText("Load the given URL");
jGoButton.setIcon(browseIcon);
jGoButton.setText("转到");
jGoButton.addActionListener(new Browser_jGoButton_actionAdapter(this));
jAddressPanel.setLayout(new BorderLayout());
jAddressTextField.addActionListener(new Browser_jAddressTextField_actionAdapter(this));
jBackButton.setToolTipText("Go back one page");
jBackButton.setHorizontalTextPosition(SwingConstants.TRAILING);
jBackButton.setEnabled(false);
jBackButton.setMaximumSize(new Dimension(75, 27));
jBackButton.setPreferredSize(new Dimension(75, 27));
jBackButton.addActionListener(new Browser_jBackButton_actionAdapter(this));
jForwardButton.setToolTipText("Go forward one page");
jForwardButton.setEnabled(false);
jForwardButton.addActionListener(new Browser_jForwardButton_actionAdapter(this));
jRefreshButton.setToolTipText("Reload current page");
jRefreshButton.setEnabled(true);
jRefreshButton.setMaximumSize(new Dimension(75, 27));
jRefreshButton.setMinimumSize(new Dimension(75, 27));
jRefreshButton.setPreferredSize(new Dimension(75, 27));
jRefreshButton.addActionListener(new Browser_jRefreshButton_actionAdapter(this));
jStopButton.setToolTipText("Stop loading this page");
jStopButton.setVerifyInputWhenFocusTarget(true);
jStopButton.setText("Stop");
jStopButton.setEnabled(true);
jStopButton.setMaximumSize(new Dimension(75, 27));
jStopButton.setMinimumSize(new Dimension(75, 27));
jStopButton.setPreferredSize(new Dimension(75, 27));
jStopButton.addActionListener(new Browser_jStopButton_actionAdapter(this));
jAddressPanel.add(jAddressLabel, BorderLayout.WEST);
jAddressPanel.add(jAddressTextField, BorderLayout.CENTER);
jAddressPanel.add(jGoButton, BorderLayout.EAST);
jAddressPanel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createEtchedBorder(),
BorderFactory.createEmptyBorder(2, 0, 2, 0)));
jBrowserToolBar.setFloatable(false);
jBrowserToolBar.add(jBackButton, null);
jBrowserToolBar.add(jForwardButton, null);
jBrowserToolBar.addSeparator();
jBrowserToolBar.add(jRefreshButton, null);
jBrowserToolBar.add(jStopButton, null);
jBrowserToolBar.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createEtchedBorder(),
BorderFactory.createEmptyBorder(2, 2, 2, 0)));
jAddrToolBarPanel.setLayout(new BorderLayout());
jAddrToolBarPanel.add(jAddressPanel, BorderLayout.CENTER);
jAddrToolBarPanel.add(jBrowserToolBar, BorderLayout.WEST);
jAddrToolBarPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0));
statusBar.setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
statusBar.lblDesc.setText("JDIC API Demo - Browser");
try {
webBrowser = new WebBrowser(new URL("http://www.amap.com/"));
// Print out debug messages in the command line.
//webBro
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Analyse.rar (93个子文件)
Analyse
bin
images
view.gif 662B
right.gif 710B
tomcat_restart.gif 184B
browser.png 1KB
tomcat.gif 923B
stop.png 911B
reload.png 817B
back.png 1KB
info.png 855B
tomcat_pause.png 704B
tomcat_error.gif 171B
folder_open.gif 981B
exit.gif 691B
forward.png 1KB
tomcat_warning.png 763B
tomcat_running.png 693B
jdic
tray.dll 56KB
MozEmbed.exe 188KB
IeEmbed.exe 60KB
jdic.dll 120KB
studio
Browser
Browser_jGoButton_actionAdapter.class 701B
Browser_jRefreshButton_actionAdapter.class 716B
Monitor$3.class 2KB
Monitor.class 6KB
Browser_jStopButton_actionAdapter.class 707B
Browser$1.class 626B
MyStatusBar.class 1KB
Browser.class 10KB
Monitor$2.class 669B
Monitor$1.class 1KB
Browser_jForwardButton_actionAdapter.class 716B
run.bat 67B
Monitor$1$1.class 707B
Browser_jAddressTextField_actionAdapter.class 725B
Browser$2.class 2KB
TabbedPane.class 1KB
Browser_jBackButton_actionAdapter.class 707B
TabbedPane$1.class 858B
jar
lucene-core-3.6.2.jar 1.47MB
dom4j-1.6.1.jar 307KB
ejb3-persistence.jar 49KB
jta.jar 13KB
log4j-1.2.16.jar 470KB
antlr-2.7.7.jar 435KB
junit.jar 118KB
avro-1.6.3.jar 286KB
jboss-logging-3.1.0.GA.jar 59KB
weka.jar 2.73MB
slf4j-api-1.6.1.jar 25KB
snappy-java-1.0.4.1.jar 973KB
jackson-core-asl-1.9.2.jar 223KB
jdic.jar 87KB
JFlex.jar 175KB
paranamer-2.3.jar 29KB
javassist-3.17.1-GA.jar 695KB
mysql-connector-java-5.1.18-bin.jar 771KB
commons-lang.jar 237KB
jackson-mapper-asl-1.9.2.jar 748KB
java-cup.jar 93KB
c3p0-0.9.1.jar 594KB
servlet.jar 78KB
JDIC.log 9KB
.settings
org.eclipse.jdt.core.prefs 598B
forms-1.3.0-src.zip 154KB
src
images
view.gif 662B
right.gif 710B
tomcat_restart.gif 184B
browser.png 1KB
tomcat.gif 923B
stop.png 911B
reload.png 817B
back.png 1KB
info.png 855B
tomcat_pause.png 704B
tomcat_error.gif 171B
folder_open.gif 981B
exit.gif 691B
forward.png 1KB
tomcat_warning.png 763B
tomcat_running.png 693B
jdic
tray.dll 56KB
MozEmbed.exe 188KB
IeEmbed.exe 60KB
jdic.dll 120KB
studio
Browser
TabbedPane.java 1KB
Browser.java 15KB
MyStatusBar.java 2KB
run.bat 67B
Monitor.java 10KB
.project 383B
.classpath 2KB
jdic.dll 120KB
forms-1.3.0.jar 120KB
共 93 条
- 1
资源评论
lin370
- 粉丝: 48
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功