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

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

?? locationsensitivedemo.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 dnd;import javax.swing.*;import javax.swing.tree.*;import javax.swing.event.*;import java.awt.*;import java.awt.datatransfer.*;import java.awt.event.*;import java.io.*;public class LocationSensitiveDemo extends JFrame {    private DefaultListModel model = new DefaultListModel();    private int count = 0;    private JTree tree;    private JComboBox indicateCombo;    private DefaultTreeModel treeModel;    private TreePath namesPath;    private static DefaultTreeModel getDefaultTreeModel() {        DefaultMutableTreeNode root = new DefaultMutableTreeNode("things");        DefaultMutableTreeNode parent;        DefaultMutableTreeNode nparent;        parent = new DefaultMutableTreeNode("colors");        root.add(parent);        parent.add(new DefaultMutableTreeNode("red"));        parent.add(new DefaultMutableTreeNode("yellow"));        parent.add(new DefaultMutableTreeNode("green"));        parent.add(new DefaultMutableTreeNode("blue"));        parent.add(new DefaultMutableTreeNode("purple"));        parent = new DefaultMutableTreeNode("names");        root.add(parent);        nparent = new DefaultMutableTreeNode("men");        nparent.add(new DefaultMutableTreeNode("jack"));        nparent.add(new DefaultMutableTreeNode("kieran"));        nparent.add(new DefaultMutableTreeNode("william"));        nparent.add(new DefaultMutableTreeNode("jose"));                parent.add(nparent);        nparent = new DefaultMutableTreeNode("women");        nparent.add(new DefaultMutableTreeNode("jennifer"));        nparent.add(new DefaultMutableTreeNode("holly"));        nparent.add(new DefaultMutableTreeNode("danielle"));        nparent.add(new DefaultMutableTreeNode("tara"));        parent.add(nparent);        parent = new DefaultMutableTreeNode("sports");        root.add(parent);        parent.add(new DefaultMutableTreeNode("basketball"));        parent.add(new DefaultMutableTreeNode("soccer"));        parent.add(new DefaultMutableTreeNode("football"));        nparent = new DefaultMutableTreeNode("hockey");        parent.add(nparent);        nparent.add(new DefaultMutableTreeNode("ice hockey"));        nparent.add(new DefaultMutableTreeNode("roller hockey"));        nparent.add(new DefaultMutableTreeNode("floor hockey"));        nparent.add(new DefaultMutableTreeNode("road hockey"));        parent = new DefaultMutableTreeNode("food");        root.add(parent);        parent.add(new DefaultMutableTreeNode("pizza"));        parent.add(new DefaultMutableTreeNode("wings"));        parent.add(new DefaultMutableTreeNode("pasta"));        nparent = new DefaultMutableTreeNode("fruit");        parent.add(nparent);        nparent.add(new DefaultMutableTreeNode("bananas"));        nparent.add(new DefaultMutableTreeNode("apples"));        nparent.add(new DefaultMutableTreeNode("grapes"));        nparent.add(new DefaultMutableTreeNode("pears"));        return new DefaultTreeModel(root);    }    public LocationSensitiveDemo() {        super("Location Sensitive Drag and Drop Demo");        treeModel = getDefaultTreeModel();        tree = new JTree(treeModel);        tree.setBorder(BorderFactory.createEmptyBorder(2, 4, 2, 4));        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);        tree.setDropMode(DropMode.ON);        namesPath = tree.getPathForRow(2);        tree.expandRow(2);        tree.expandRow(1);        tree.setRowHeight(0);        tree.setTransferHandler(new TransferHandler() {            public boolean canImport(TransferHandler.TransferSupport info) {                // for the demo, we'll only support drops (not clipboard paste)                if (!info.isDrop()) {                    return false;                }                String item = (String)indicateCombo.getSelectedItem();                                if (item.equals("Always")) {                    info.setShowDropLocation(true);                } else if (item.equals("Never")) {                    info.setShowDropLocation(false);                }                // we only import Strings                if (!info.isDataFlavorSupported(DataFlavor.stringFlavor)) {                    return false;                }                // fetch the drop location                JTree.DropLocation dl = (JTree.DropLocation)info.getDropLocation();                TreePath path = dl.getPath();                // we don't support invalid paths or descendants of the names folder                if (path == null || namesPath.isDescendant(path)) {                    return false;                }                return true;            }            public boolean importData(TransferHandler.TransferSupport info) {                // if we can't handle the import, say so                if (!canImport(info)) {                    return false;                }                // fetch the drop location                JTree.DropLocation dl = (JTree.DropLocation)info.getDropLocation();                                // fetch the path and child index from the drop location                TreePath path = dl.getPath();                int childIndex = dl.getChildIndex();                // fetch the data and bail if this fails                String data;                try {                    data = (String)info.getTransferable().getTransferData(DataFlavor.stringFlavor);                } catch (UnsupportedFlavorException e) {                    return false;                } catch (IOException e) {                    return false;                }                // if child index is -1, the drop was on top of the path, so we'll                // treat it as inserting at the end of that path's list of children                if (childIndex == -1) {                    childIndex = tree.getModel().getChildCount(path.getLastPathComponent());                }                // create a new node to represent the data and insert it into the model                DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(data);                DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)path.getLastPathComponent();                treeModel.insertNodeInto(newNode, parentNode, childIndex);                // make the new node visible and scroll so that it's visible                tree.makeVisible(path.pathByAddingChild(newNode));                tree.scrollRectToVisible(tree.getPathBounds(path.pathByAddingChild(newNode)));                // demo stuff - remove for blog                model.removeAllElements();                model.insertElementAt("String " + (++count), 0);                // end demo stuff                return true;            }        });        JList dragFrom = new JList(model);        dragFrom.setFocusable(false);        dragFrom.setPrototypeCellValue("String 0123456789");        model.insertElementAt("String " + count, 0);        dragFrom.setDragEnabled(true);        dragFrom.setBorder(BorderFactory.createLoweredBevelBorder());        JPanel p = new JPanel();        p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));        JPanel wrap = new JPanel();        wrap.add(new JLabel("Drag from here:"));        wrap.add(dragFrom);        p.add(Box.createHorizontalStrut(4));        p.add(Box.createGlue());        p.add(wrap);        p.add(Box.createGlue());        p.add(Box.createHorizontalStrut(4));        getContentPane().add(p, BorderLayout.NORTH);        getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);        indicateCombo = new JComboBox(new String[] {"Default", "Always", "Never"});        indicateCombo.setSelectedItem("INSERT");        p = new JPanel();        p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));        wrap = new JPanel();        wrap.add(new JLabel("Show drop location:"));        wrap.add(indicateCombo);        p.add(Box.createHorizontalStrut(4));        p.add(Box.createGlue());        p.add(wrap);        p.add(Box.createGlue());        p.add(Box.createHorizontalStrut(4));        getContentPane().add(p, BorderLayout.SOUTH);        getContentPane().setPreferredSize(new Dimension(400, 450));    }    private static void increaseFont(String type) {        Font font = UIManager.getFont(type);        font = font.deriveFont(font.getSize() + 4f);        UIManager.put(type, font);    }    private static void createAndShowGUI() {        //Create and set up the window.        LocationSensitiveDemo test = new LocationSensitiveDemo();        test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);                //Display the window.        test.pack();        test.setVisible(true);    }    public static void main(String[] args) {        SwingUtilities.invokeLater(new Runnable() {            public void run() {                                try {                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");                    increaseFont("Tree.font");                    increaseFont("Label.font");                    increaseFont("ComboBox.font");                    increaseFont("List.font");                } catch (Exception e) {}                //Turn off metal's use of bold fonts	        UIManager.put("swing.boldMetal", Boolean.FALSE);                createAndShowGUI();            }        });    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲图片欧美激情| 欧美午夜宅男影院| 国产亚洲精品aa午夜观看| 国内久久精品视频| 欧美草草影院在线视频| 国产乱码精品一区二区三区忘忧草| 亚洲精品一区二区三区香蕉| 国产精品中文字幕欧美| 国产精品每日更新| 欧美日韩一区小说| 精品一区二区免费| 国产精品你懂的| 欧美亚一区二区| 国内外成人在线| 亚洲美女视频在线| 777色狠狠一区二区三区| 国产在线精品一区二区| 国产精品久久久久久久久免费樱桃 | 26uuu国产一区二区三区| 国产ts人妖一区二区| 一区二区三区成人在线视频| 欧美一区二区三区在线| 国产高清不卡二三区| 亚洲久本草在线中文字幕| 在线不卡中文字幕| 成人免费av资源| 午夜成人在线视频| 国产精品网站导航| 91精品国产一区二区三区香蕉| 国产精品1区二区.| 性感美女极品91精品| 国产午夜精品一区二区| 欧美日本在线视频| 99久久免费视频.com| 日本欧美一区二区三区乱码| 国产精品久久久久久亚洲伦| 欧美一区二区三区免费观看视频| 成人一级片在线观看| 视频在线观看国产精品| 中文字幕制服丝袜成人av| 制服丝袜激情欧洲亚洲| 97精品国产露脸对白| 九色综合国产一区二区三区| 一区二区三区中文免费| 久久久蜜桃精品| 欧美丰满少妇xxxbbb| 97久久精品人人澡人人爽| 毛片基地黄久久久久久天堂| 夜色激情一区二区| 欧美国产综合色视频| 日韩一区二区精品葵司在线| 一本色道久久加勒比精品| 国产馆精品极品| 蜜臀va亚洲va欧美va天堂| 亚洲欧美另类综合偷拍| 国产亚洲精品7777| 精品日韩成人av| 欧美一级精品在线| 69久久99精品久久久久婷婷| 在线观看一区日韩| 91在线免费看| 成人av在线电影| 夫妻av一区二区| 国产精品一区二区视频| 精彩视频一区二区三区| 日本欧美一区二区三区乱码 | 日韩欧美成人激情| 欧美日韩久久一区| 欧美日韩精品二区第二页| 一本到三区不卡视频| 99re这里都是精品| 色偷偷88欧美精品久久久| hitomi一区二区三区精品| 国产一区二区毛片| 国产精品一区一区| 国产精品亚洲一区二区三区妖精| 九色|91porny| 国内成人精品2018免费看| 国产乱码精品一区二区三区忘忧草 | 极品少妇一区二区| 激情久久五月天| 国产一区二区三区久久久| 久久精品国产精品亚洲红杏| 久久超碰97中文字幕| 欧美在线观看视频在线| 91亚洲精品久久久蜜桃网站| 91丨九色丨黑人外教| 欧美在线免费视屏| 欧美男男青年gay1069videost| 在线看国产一区| 7777精品伊人久久久大香线蕉的 | 91捆绑美女网站| 色先锋资源久久综合| 在线精品视频一区二区| 7777精品伊人久久久大香线蕉的 | 北条麻妃国产九九精品视频| 色综合久久久久久久久久久| 欧美人与禽zozo性伦| 欧美一区二区三区播放老司机| 精品国产乱码久久久久久久| 中文一区二区在线观看| 亚洲精品成人天堂一二三| 亚洲国产成人tv| 麻豆91在线播放免费| 国产成a人亚洲精| 日本高清无吗v一区| 欧美精品免费视频| 亚洲一区在线免费观看| 日本不卡中文字幕| 国产999精品久久久久久绿帽| 91污片在线观看| 欧美一卡在线观看| 亚洲国产成人自拍| 午夜久久电影网| 大陆成人av片| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲欧美日韩国产另类专区 | 亚洲一区二区三区四区不卡| 欧美电影影音先锋| 久久女同性恋中文字幕| 国产精品私人影院| 亚洲狠狠丁香婷婷综合久久久| 婷婷久久综合九色综合伊人色| 久久99精品久久久久久久久久久久| 国产成人啪免费观看软件 | 欧美激情一区二区三区全黄| 亚洲欧洲国产日韩| 肉色丝袜一区二区| eeuss鲁片一区二区三区在线观看| 欧美专区日韩专区| 日韩精品一区国产麻豆| 中文字幕五月欧美| 日韩精品一级二级 | 91精品国产高清一区二区三区| 久久日韩精品一区二区五区| 最新久久zyz资源站| 日韩精品视频网| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 亚洲猫色日本管| 日韩福利电影在线观看| 成人美女视频在线观看18| 欧美日韩在线综合| 国产欧美一区二区在线| 蜜桃视频在线观看一区二区| bt欧美亚洲午夜电影天堂| 日韩一区二区在线免费观看| 中文字幕亚洲一区二区va在线| 一级日本不卡的影视| 国产一区在线看| 制服丝袜亚洲网站| 一区二区在线观看免费| 久久av资源网| 欧美午夜精品免费| 国产精品麻豆久久久| 麻豆精品在线播放| 欧美日本一区二区三区四区| 一区二区三区.www| 国产激情一区二区三区四区 | 99精品视频在线播放观看| 日韩欧美色综合| 日韩av电影一区| 精品视频一区二区不卡| 亚洲v精品v日韩v欧美v专区| gogo大胆日本视频一区| 国产欧美日韩视频在线观看| 麻豆精品一区二区av白丝在线| 欧美精品xxxxbbbb| 艳妇臀荡乳欲伦亚洲一区| 91免费在线看| 国产精品久99| 蜜臀久久99精品久久久画质超高清 | 欧美日本韩国一区二区三区视频| 亚洲国产毛片aaaaa无费看| 99久久久国产精品免费蜜臀| 欧美国产欧美综合| 福利一区二区在线观看| 久久蜜桃av一区精品变态类天堂| 国产乱码精品一区二区三区忘忧草 | 首页国产丝袜综合| 欧美一区二区女人| 免费成人美女在线观看| 欧美日本国产一区| 日本强好片久久久久久aaa| 欧美在线观看一区| 日韩成人dvd| 日韩欧美电影一区| 国产乱码精品一区二区三区av| 精品国产乱码久久久久久浪潮| 成人性视频免费网站| 国产精品天天摸av网| 不卡一区在线观看| 亚洲色图另类专区| 99久久综合99久久综合网站| 亚洲国产成人91porn| 欧美日韩另类一区| 久久99热99| 欧美一级在线免费| 丁香婷婷综合色啪| 亚洲色图一区二区| 欧美日高清视频|