亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? webbrowser.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.gui;import java.awt.*;                 // LayoutManager stuffimport javax.swing.*;              // Swing componentsimport java.awt.event.*;           // AWT event handlersimport javax.swing.event.*;        // Swing event handlersimport java.beans.*;               // JavaBeans event handlersimport java.awt.print.*;           // Printing functionalityimport java.io.*;                  // Input/outputimport java.net.*;                 // Networking with URLsimport java.util.*;                // Hashtables and other utilities// Import this class by name.  JFileChooser uses it, and its name conflicts// with java.io.FileFilterimport javax.swing.filechooser.FileFilter;  // Import a class for printing Swing documents.  See printing chapter.import com.davidflanagan.examples.print.PrintableDocument;/** * This class implements a simple web browser using the HTML * display capabilities of the JEditorPane component. **/public class WebBrowser extends JFrame    implements HyperlinkListener, PropertyChangeListener{    /**     * A simple main() method that allows the WebBrowser class to be used     * as a stand-alone application.     **/    public static void main(String[] args) throws IOException {	// End the program when there are no more open browser windows	WebBrowser.setExitWhenLastWindowClosed(true);	WebBrowser browser = new WebBrowser();  // Create a browser window	browser.setSize(800, 600);              // Set its size	browser.setVisible(true);               // Make it visible.	// Tell the browser what to display.  This method is defined below.	browser.displayPage((args.length > 0) ? args[0] : browser.getHome());    }        // This class uses GUIResourceBundle to create its menubar and toolbar    // This static initializer performs one-time registration of the    // required ResourceParser classes.    static {	GUIResourceBundle.registerResourceParser(new MenuBarParser());	GUIResourceBundle.registerResourceParser(new MenuParser());	GUIResourceBundle.registerResourceParser(new ActionParser());	GUIResourceBundle.registerResourceParser(new CommandParser());	GUIResourceBundle.registerResourceParser(new ToolBarParser());    }    // These are the Swing components that the browser uses    JEditorPane textPane;      // Where the HTML is displayed    JLabel messageLine;        // Displays one-line messages    JTextField urlField;       // Displays and edits the current URL    JFileChooser fileChooser;  // Allows the user to select a local file    // These are Actions that are used in the menubar and toolbar.    // We obtain explicit references to them from the GUIResourceBundle    // so we can enable and disable them.    Action backAction, forwardAction;    // These fields are used to maintain the browsing history of the window    java.util.List history = new ArrayList();  // The history list    int currentHistoryPage = -1;               // Current location in it    public static final int MAX_HISTORY = 50;  // Trim list when over this size    // These static fields control the behavior of the close() action    static int numBrowserWindows = 0;    static boolean exitWhenLastWindowClosed = false;    // This is where the "home()" method takes us.  See also setHome()    String home = "http://www.davidflanagan.com";  // A default value    /** Create and initialize a new WebBrowser window */    public WebBrowser() {	super();                          // Chain to JFrame constructor	textPane = new JEditorPane();     // Create HTML window	textPane.setEditable(false);      // Don't allow the user to edit it	// Register action listeners.  The first is to handle hyperlinks.	// The second is to receive property change notifications, which tell	// us when a document is done loading.  This class implements these	// EventListener interfaces, and the methods are defined below	textPane.addHyperlinkListener(this); 	textPane.addPropertyChangeListener(this);	// Put the text pane in a JScrollPane in the center of the window	this.getContentPane().add(new JScrollPane(textPane),				  BorderLayout.CENTER);	// Now create a message line and place it at the bottom of the window	messageLine = new JLabel(" ");	this.getContentPane().add(messageLine, BorderLayout.SOUTH);	// Read the file WebBrowserResources.properties (and any localized	// variants appropriate for the current Locale) to create a	// GUIResourceBundle from which we'll get our menubar and toolbar.	GUIResourceBundle resources =	    new GUIResourceBundle(this,"com.davidflanagan.examples.gui." +				  "WebBrowserResources");	// Read a menubar from the resource bundle and display it	JMenuBar menubar = (JMenuBar) resources.getResource("menubar",							    JMenuBar.class);	this.setJMenuBar(menubar);	// Read a toolbar from the resource bundle.  Don't display it yet.	JToolBar toolbar = 	    (JToolBar) resources.getResource("toolbar", JToolBar.class);	// Create a text field that the user can enter a URL in.	// Set up an action listener to respond to the ENTER key in that field	urlField = new JTextField();	urlField.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) {		    displayPage(urlField.getText());		}	    });	// Add the URL field and a label for it to the end of the toolbar	toolbar.add(new JLabel("         URL:"));	toolbar.add(urlField);	// And add the toolbar to the top of the window	this.getContentPane().add(toolbar, BorderLayout.NORTH);	// Read cached copies of two Action objects from the resource bundle	// These actions are used by the menubar and toolbar, and enabling and	// disabling them enables and disables the menu and toolbar items.	backAction = (Action)resources.getResource("action.back",Action.class);	forwardAction =	    (Action)resources.getResource("action.forward", Action.class);	// Start off with both actions disabled	backAction.setEnabled(false);	forwardAction.setEnabled(false);		// Create a ThemeManager for this frame, 	// and add a Theme menu to the menubar	ThemeManager themes = new ThemeManager(this, resources);	menubar.add(themes.getThemeMenu());	// Keep track of how many web browser windows are open	WebBrowser.numBrowserWindows++;    }    /** Set the static property that controls the behavior of close() */    public static void setExitWhenLastWindowClosed(boolean b) {	exitWhenLastWindowClosed = b;    }    /** These are accessor methods for the home property. */    public void setHome(String home) { this.home = home; }    public String getHome() { return home; }    /**     * This internal method attempts to load and display the specified URL.     * It is called from various places throughout the class.     **/    boolean visit(URL url) {	try {	    String href = url.toString();	    // Start animating.  Animation is stopped in propertyChanged()	    startAnimation("Loading " + href + "...");  	    textPane.setPage(url);   // Load and display the URL 	    this.setTitle(href);     // Display URL in window titlebar	    urlField.setText(href);  // Display URL in text input field	    return true;             // Return success	}	catch (IOException ex) {     // If page loading fails	    stopAnimation();	    messageLine.setText("Can't load page: " + ex.getMessage());	    return false;            // Return failure	}    }    /**     * Ask the browser to display the specified URL, and put it in the     * history list.     **/    public void displayPage(URL url) {	if (visit(url)) {    // go to the specified url, and if we succeed:	    history.add(url);       // Add the url to the history list	    int numentries = history.size();	    if (numentries > MAX_HISTORY+10) {  // Trim history when too large		history = history.subList(numentries-MAX_HISTORY, numentries);		numentries = MAX_HISTORY;	    }	    currentHistoryPage = numentries-1;  // Set current history page

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人精品鲁一区一区二区| 国产亚洲精久久久久久| 一区二区三区久久久| 91年精品国产| 一区二区三区在线不卡| 欧美亚洲精品一区| 亚洲欧洲精品一区二区精品久久久 | 国产亚洲欧美一级| 久久爱另类一区二区小说| 日韩三级在线免费观看| 国精产品一区一区三区mba视频 | 久久日韩粉嫩一区二区三区| 国产aⅴ综合色| 亚洲免费在线看| 在线成人高清不卡| 精品一区二区三区视频| 国产精品久久毛片a| 欧美自拍丝袜亚洲| 久久成人18免费观看| 国产人成亚洲第一网站在线播放| 99精品视频在线免费观看| 偷拍一区二区三区| 久久久国产一区二区三区四区小说| 成人动漫av在线| 亚洲 欧美综合在线网络| 精品va天堂亚洲国产| 91麻豆成人久久精品二区三区| 日韩高清电影一区| 中文字幕欧美日韩一区| 欧美日韩在线观看一区二区 | 国产福利精品导航| 亚洲v精品v日韩v欧美v专区| 国产亚洲综合av| 欧美日韩免费高清一区色橹橹 | 91一区一区三区| 亚洲最新在线观看| 精品国产不卡一区二区三区| av一区二区三区四区| 亚洲成人av在线电影| 欧美国产成人在线| 日韩午夜激情电影| 色婷婷国产精品| 国产美女视频91| 午夜精品福利视频网站| 亚洲视频一区二区在线| 久久午夜免费电影| 欧美午夜电影一区| 91玉足脚交白嫩脚丫在线播放| 理论电影国产精品| 久久中文娱乐网| 欧美美女喷水视频| 91农村精品一区二区在线| 国产在线看一区| 亚洲成a人在线观看| 中文字幕中文乱码欧美一区二区 | 午夜国产精品影院在线观看| 国产精品理伦片| 国产日韩欧美a| 欧美精品一区二区三区四区 | 精品国产伦一区二区三区免费| 欧美午夜精品久久久| 成人性生交大片免费看视频在线| 黄色精品一二区| 麻豆精品精品国产自在97香蕉| 亚洲电影一区二区三区| 亚洲人成7777| ●精品国产综合乱码久久久久| 中文字幕 久热精品 视频在线| 精品欧美一区二区三区精品久久| 欧美猛男男办公室激情| 欧美日韩一区精品| 欧美少妇xxx| 欧美日韩在线观看一区二区| 欧美亚洲一区二区三区四区| 91精品办公室少妇高潮对白| 色诱亚洲精品久久久久久| av成人免费在线| 97久久人人超碰| 99精品视频在线观看免费| 97久久超碰精品国产| 91在线观看免费视频| 99久久99久久精品免费观看| 色域天天综合网| 欧美色精品在线视频| 在线播放亚洲一区| 欧美一区二区三区电影| 日韩久久久久久| 久久久久久久精| 国产精品麻豆99久久久久久| 亚洲欧美激情小说另类| 一区二区三区国产精华| 亚洲va韩国va欧美va精品| 日本欧洲一区二区| 九九国产精品视频| 成人午夜精品一区二区三区| 91免费版在线| 欧美日韩不卡一区| 精品少妇一区二区三区日产乱码 | 26uuu欧美| 国产日韩精品视频一区| 国产精品成人免费在线| 亚洲愉拍自拍另类高清精品| 亚洲v中文字幕| 久久se精品一区二区| 国产乱一区二区| 99精品在线免费| 7777女厕盗摄久久久| 久久久久99精品一区| 一区二区在线电影| 美女视频一区二区三区| 成人黄色a**站在线观看| 欧美日韩中文另类| 久久久亚洲高清| 亚洲午夜久久久久久久久电影网 | 国产在线看一区| 97久久精品人人做人人爽| 欧美私模裸体表演在线观看| 精品国产欧美一区二区| 一区二区三区日韩欧美| 美女网站色91| 91麻豆高清视频| 欧美成人性福生活免费看| 亚洲欧美区自拍先锋| 精品一区二区三区在线观看| 91免费精品国自产拍在线不卡| 日韩一卡二卡三卡| 亚洲欧美在线另类| 久久成人羞羞网站| 色婷婷激情久久| 国产亚洲综合av| 日韩激情一区二区| 91一区二区在线观看| 久久女同精品一区二区| 天天色图综合网| 国产一区二区91| 欧美无砖砖区免费| 国产精品天美传媒沈樵| 欧美a级理论片| 日本二三区不卡| 久久影院午夜论| 午夜精品久久久久久久| 91麻豆国产在线观看| 久久精品视频一区二区| 日韩电影一区二区三区四区| 色婷婷精品久久二区二区蜜臂av| 精品日韩欧美一区二区| 日本系列欧美系列| 欧美日韩一区二区在线观看| 国产精品乱码一区二三区小蝌蚪| 久久国产精品区| 欧美日韩国产大片| 一区二区三区日韩欧美精品| 成人av小说网| 国产欧美一区二区精品秋霞影院 | 国产91色综合久久免费分享| 日韩欧美国产一区二区在线播放 | 91精品国产一区二区| 欧美激情在线看| 国产精一区二区三区| 欧美岛国在线观看| 日韩电影一二三区| 91精品免费在线| 调教+趴+乳夹+国产+精品| 欧美中文字幕一区| 亚洲自拍另类综合| 欧美日韩一级片在线观看| 一区二区三区日韩欧美| 欧洲一区在线观看| 亚洲国产中文字幕| 欧美麻豆精品久久久久久| 日韩在线观看一区二区| 777奇米四色成人影色区| 免费在线观看精品| 日韩一区二区在线观看视频播放| 日韩电影免费一区| 欧美一区二区在线视频| 精品在线你懂的| 国产日韩欧美亚洲| 97超碰欧美中文字幕| 亚洲精品成人a在线观看| 欧美日韩一区二区三区在线看| 五月激情丁香一区二区三区| 日韩精品一区二区在线| 国产综合久久久久影院| 国产日本欧洲亚洲| 99r国产精品| 午夜精品在线视频一区| 精品国内二区三区| 成人国产免费视频| 亚洲一区二区三区自拍| 欧美一区二区三区男人的天堂| 国产在线国偷精品免费看| 中文字幕第一页久久| 欧美午夜宅男影院| 精品一二三四区| 国产精品传媒在线| 91精品黄色片免费大全| 国产精品一区二区久久不卡| 17c精品麻豆一区二区免费| 538在线一区二区精品国产|