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

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

?? icondemoapp.java

?? java tutotrials or beginners
?? JAVA
字號:
/* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * *   - Redistributions of source code must retain the above copyright *     notice, this list of conditions and the following disclaimer. * *   - Redistributions in binary form must reproduce the above copyright *     notice, this list of conditions and the following disclaimer in the *     documentation and/or other materials provided with the distribution. * *   - Neither the name of Sun Microsystems nor the names of its *     contributors may be used to endorse or promote products derived *     from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package components;import java.awt.BorderLayout;import java.awt.Graphics2D;import java.awt.Image;import java.awt.RenderingHints;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.image.BufferedImage;import java.util.ArrayList;import java.util.Collection;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Set;import java.util.TreeSet;import javax.swing.AbstractAction;import javax.swing.BorderFactory;import javax.swing.Box;import javax.swing.Icon;import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JToolBar;import javax.swing.SwingUtilities;import javax.swing.SwingWorker;/** * This application is intended to demonstrate the loading of image files into icons * for use in a Swing user interface. It creates a toolbar with a thumbnail preview * of each image.  Clicking on the thumbnail will show the full image * in the main display area. * * IconDemoApp.java requires the following files: <br> * The following files are copyright 2006 spriggs.net and licensed under a * Creative Commons License (http://creativecommons.org/licenses/by-sa/3.0/) * <br> * images/sunw01.jpg <br> * images/sunw02.jpg <br> * images/sunw03.jpg <br> * images/sunw04.jpg <br> * images/sunw05.jpg <br> * * @author Collin Fagan * @date 7/25/2007 * @version 2.0 */public class IconDemoApp extends JFrame {        private JLabel photographLabel = new JLabel();    private JToolBar buttonBar = new JToolBar();        private String imagedir = "images/";        private MissingIcon placeholderIcon = new MissingIcon();        /**     * List of all the descriptions of the image files. These correspond one to     * one with the image file names     */    private String[] imageCaptions = { "Original SUNW Logo", "The Clocktower",    "Clocktower from the West", "The Mansion", "Sun Auditorium"};        /**     * List of all the image files to load.     */    private String[] imageFileNames = { "sunw01.jpg", "sunw02.jpg",    "sunw03.jpg", "sunw04.jpg", "sunw05.jpg"};        /**     * Main entry point to the demo. Loads the Swing elements on the "Event     * Dispatch Thread".     *     * @param args     */    public static void main(String args[]) {        SwingUtilities.invokeLater(new Runnable() {            public void run() {                IconDemoApp app = new IconDemoApp();                app.setVisible(true);            }        });    }        /**     * Default constructor for the demo.     */    public IconDemoApp() {        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        setTitle("Icon Demo: Please Select an Image");                // A label for displaying the pictures        photographLabel.setVerticalTextPosition(JLabel.BOTTOM);        photographLabel.setHorizontalTextPosition(JLabel.CENTER);        photographLabel.setHorizontalAlignment(JLabel.CENTER);        photographLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));                // We add two glue components. Later in process() we will add thumbnail buttons        // to the toolbar inbetween thease glue compoents. This will center the        // buttons in the toolbar.        buttonBar.add(Box.createGlue());        buttonBar.add(Box.createGlue());                add(buttonBar, BorderLayout.SOUTH);        add(photographLabel, BorderLayout.CENTER);                setSize(400, 300);                // this centers the frame on the screen        setLocationRelativeTo(null);                // start the image loading SwingWorker in a background thread        loadimages.execute();    }        /**     * SwingWorker class that loads the images a background thread and calls publish     * when a new one is ready to be displayed.     *     * We use Void as the first SwingWroker param as we do not need to return     * anything from doInBackground().     */    private SwingWorker<Void, ThumbnailAction> loadimages = new SwingWorker<Void, ThumbnailAction>() {                /**         * Creates full size and thumbnail versions of the target image files.         */        @Override        protected Void doInBackground() throws Exception {            for (int i = 0; i < imageCaptions.length; i++) {                ImageIcon icon;                icon = createImageIcon(imagedir + imageFileNames[i], imageCaptions[i]);                                ThumbnailAction thumbAction;                if(icon != null){                                        ImageIcon thumbnailIcon = new ImageIcon(getScaledImage(icon.getImage(), 32, 32));                                        thumbAction = new ThumbnailAction(icon, thumbnailIcon, imageCaptions[i]);                                    }else{                    // the image failed to load for some reason                    // so load a placeholder instead                    thumbAction = new ThumbnailAction(placeholderIcon, placeholderIcon, imageCaptions[i]);                }                publish(thumbAction);            }            // unfortunately we must return something, and only null is valid to            // return when the return type is void.            return null;        }                /**         * Process all loaded images.         */        @Override        protected void process(List<ThumbnailAction> chunks) {            for (ThumbnailAction thumbAction : chunks) {                JButton thumbButton = new JButton(thumbAction);                // add the new button BEFORE the last glue                // this centers the buttons in the toolbar                buttonBar.add(thumbButton, buttonBar.getComponentCount() - 1);            }        }    };        /**     * Creates an ImageIcon if the path is valid.     * @param String - resource path     * @param String - description of the file     */    protected ImageIcon createImageIcon(String path,            String description) {        java.net.URL imgURL = getClass().getResource(path);        if (imgURL != null) {            return new ImageIcon(imgURL, description);        } else {            System.err.println("Couldn't find file: " + path);            return null;        }    }        /**     * Resizes an image using a Graphics2D object backed by a BufferedImage.     * @param srcImg - source image to scale     * @param w - desired width     * @param h - desired height     * @return - the new resized image     */    private Image getScaledImage(Image srcImg, int w, int h){        BufferedImage resizedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);        Graphics2D g2 = resizedImg.createGraphics();        g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);        g2.drawImage(srcImg, 0, 0, w, h, null);        g2.dispose();        return resizedImg;    }        /**     * Action class that shows the image specified in it's constructor.     */    private class ThumbnailAction extends AbstractAction{                /**         *The icon if the full image we want to display.         */        private Icon displayPhoto;                /**         * @param Icon - The full size photo to show in the button.         * @param Icon - The thumbnail to show in the button.         * @param String - The descriptioon of the icon.         */        public ThumbnailAction(Icon photo, Icon thumb, String desc){            displayPhoto = photo;                        // The short description becomes the tooltip of a button.            putValue(SHORT_DESCRIPTION, desc);                        // The LARGE_ICON_KEY is the key for setting the            // icon when an Action is applied to a button.            putValue(LARGE_ICON_KEY, thumb);        }                /**         * Shows the full image in the main area and sets the application title.         */        public void actionPerformed(ActionEvent e) {            photographLabel.setIcon(displayPhoto);            setTitle("Icon Demo: " + getValue(SHORT_DESCRIPTION).toString());        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区欧美| 国产成人a级片| 久久综合色综合88| 99re这里都是精品| 日本午夜一区二区| 亚洲欧美日韩中文播放 | 欧美精品亚洲一区二区在线播放| 激情综合网天天干| 自拍偷自拍亚洲精品播放| 911精品国产一区二区在线| 粉嫩久久99精品久久久久久夜| 男人操女人的视频在线观看欧美| 亚洲男帅同性gay1069| 26uuu亚洲| 欧美一区二区日韩| 欧美日韩中文国产| 日本高清无吗v一区| www.日本不卡| 国产a级毛片一区| 国产一区二区三区四区在线观看 | 三级不卡在线观看| 一区二区三区成人| 综合久久久久久| 国产精品私人自拍| 久久久久久9999| 精品国产亚洲在线| 日韩一区二区三区在线| 欧美在线观看一区二区| 91一区二区在线| 99视频在线精品| 国产精品主播直播| 精品一二三四区| 日韩黄色小视频| 亚洲综合网站在线观看| 亚洲色图欧洲色图婷婷| 国产蜜臀av在线一区二区三区| 欧美精品一区二区三区高清aⅴ | 亚洲自拍偷拍图区| 亚洲一线二线三线视频| 亚洲成人av在线电影| 一区二区三区不卡视频在线观看 | 丁香啪啪综合成人亚洲小说| 国产综合色视频| 国产一区二三区| 国产东北露脸精品视频| 成人在线视频一区二区| av电影天堂一区二区在线观看| 成人av高清在线| 久久久久久电影| 国产精品看片你懂得| 中文字幕一区二区5566日韩| 亚洲激情在线播放| 日韩中文欧美在线| 久久精品国产第一区二区三区| 激情成人午夜视频| 成人亚洲精品久久久久软件| 91色婷婷久久久久合中文| 色老汉一区二区三区| 欧美日韩视频在线一区二区| 制服丝袜在线91| 精品成人a区在线观看| 国产欧美日韩亚州综合| 国产免费观看久久| 亚洲视频中文字幕| 亚洲最新视频在线观看| 亚洲第一成年网| 寂寞少妇一区二区三区| av电影在线观看完整版一区二区| 欧美在线免费观看视频| 26uuuu精品一区二区| 日韩码欧中文字| 奇米色一区二区三区四区| 国产乱子轮精品视频| 一本色道综合亚洲| 日韩一区二区免费在线电影| 国产精品私房写真福利视频| 亚洲大片免费看| 国产精品主播直播| 欧美日韩大陆一区二区| 4hu四虎永久在线影院成人| 日韩欧美国产系列| 国产精品无码永久免费888| 亚洲成年人影院| 成人免费av网站| 91精品国产一区二区三区蜜臀| 国产精品网站在线播放| 午夜精品一区二区三区免费视频| 国产九色sp调教91| 欧美日韩激情一区二区| 国产精品久久久久久久久快鸭| 日一区二区三区| 91日韩精品一区| 久久网这里都是精品| 亚洲sss视频在线视频| 丁香六月久久综合狠狠色| 日韩一级视频免费观看在线| 亚洲欧美国产三级| 国产成人精品在线看| 717成人午夜免费福利电影| **欧美大码日韩| 国产精选一区二区三区| 91麻豆精品国产自产在线| 亚洲欧美一区二区久久| 国产福利91精品一区| 日韩欧美高清一区| 亚洲不卡av一区二区三区| 国产91对白在线观看九色| 日韩欧美国产精品| 一区二区三区欧美亚洲| 高清免费成人av| 正在播放亚洲一区| 亚洲人妖av一区二区| 精品一区二区在线观看| 色88888久久久久久影院野外| 欧美r级在线观看| 亚洲一级片在线观看| 国产91精品精华液一区二区三区 | 福利一区二区在线| 在线成人小视频| 亚洲一区欧美一区| 不卡的av电影| 国产欧美精品一区二区色综合| 五月激情综合婷婷| 在线视频一区二区三区| 欧美一区二区私人影院日本| 亚洲综合激情小说| 91久久精品一区二区三区| 久久久亚洲精品石原莉奈| 视频在线观看91| 欧美午夜精品一区二区蜜桃| 中文文精品字幕一区二区| 日韩精品成人一区二区三区| 欧美日韩激情在线| 亚洲永久精品国产| 欧美日韩精品一区二区在线播放| 一区二区三区四区高清精品免费观看| 97se亚洲国产综合自在线| **性色生活片久久毛片| 在线免费观看日本欧美| 亚洲综合一二区| 欧美三级日韩三级| 日欧美一区二区| 欧美tickle裸体挠脚心vk| 国产乱码精品一区二区三| 国产欧美日韩精品a在线观看| 国产99久久久国产精品免费看| 亚洲国产经典视频| 91麻豆免费在线观看| 一区在线播放视频| 99久久精品一区二区| 国产精品天美传媒沈樵| 99视频有精品| 亚洲精品一二三区| 91视频观看视频| 亚洲一区二区三区四区中文字幕 | 久久综合一区二区| 国产xxx精品视频大全| 中文字幕一区免费在线观看| 99国产麻豆精品| 亚洲一区二区3| 日韩亚洲欧美综合| 国产成人一区在线| 亚洲人成网站精品片在线观看| 99精品国产热久久91蜜凸| 亚洲午夜私人影院| 精品福利一区二区三区免费视频| 国产成人午夜精品影院观看视频 | 亚洲线精品一区二区三区八戒| 日韩欧美一级片| 成人av影院在线| 日韩精品福利网| 欧美国产乱子伦| 欧美日韩国产小视频| 国产精品自产自拍| 亚洲国产日韩一区二区| 精品国精品国产尤物美女| 91啪九色porn原创视频在线观看| 五月天亚洲婷婷| 中文字幕欧美一| 精品少妇一区二区三区在线视频| 99精品久久久久久| 麻豆精品一区二区av白丝在线| 中文字幕亚洲区| 精品人伦一区二区色婷婷| proumb性欧美在线观看| 日韩国产欧美在线播放| 一区在线观看免费| 精品久久久久香蕉网| 欧美在线免费观看视频| 成人免费精品视频| 久久爱www久久做| 亚洲综合清纯丝袜自拍| 国产午夜亚洲精品不卡| 欧美乱妇20p| 色诱视频网站一区| 国产成人在线视频网站| 久久精品99久久久| 亚洲成av人在线观看| 亚洲人被黑人高潮完整版| 中文字幕乱码久久午夜不卡|