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

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

?? tableselectiondemo.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;/* * TableSelectionDemo.java requires no other files. */import javax.swing.*;import javax.swing.table.AbstractTableModel;import javax.swing.event.ListSelectionEvent;import javax.swing.event.ListSelectionListener;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.GridLayout;import java.awt.Dimension;public class TableSelectionDemo extends JPanel                                 implements ActionListener {     private JTable table;    private JCheckBox rowCheck;    private JCheckBox columnCheck;    private JCheckBox cellCheck;    private ButtonGroup buttonGroup;    private JTextArea output;    public TableSelectionDemo() {        super();        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));        table = new JTable(new MyTableModel());        table.setPreferredScrollableViewportSize(new Dimension(500, 70));        table.setFillsViewportHeight(true);        table.getSelectionModel().addListSelectionListener(new RowListener());        table.getColumnModel().getSelectionModel().            addListSelectionListener(new ColumnListener());        add(new JScrollPane(table));        add(new JLabel("Selection Mode"));        buttonGroup = new ButtonGroup();        addRadio("Multiple Interval Selection").setSelected(true);        addRadio("Single Selection");        addRadio("Single Interval Selection");        add(new JLabel("Selection Options"));        rowCheck = addCheckBox("Row Selection");        rowCheck.setSelected(true);        columnCheck = addCheckBox("Column Selection");        cellCheck = addCheckBox("Cell Selection");        cellCheck.setEnabled(false);        output = new JTextArea(5, 40);        output.setEditable(false);        add(new JScrollPane(output));    }    private JCheckBox addCheckBox(String text) {        JCheckBox checkBox = new JCheckBox(text);        checkBox.addActionListener(this);        add(checkBox);        return checkBox;    }    private JRadioButton addRadio(String text) {        JRadioButton b = new JRadioButton(text);        b.addActionListener(this);        buttonGroup.add(b);        add(b);        return b;    }    public void actionPerformed(ActionEvent event) {        String command = event.getActionCommand();        //Cell selection is disabled in Multiple Interval Selection        //mode. The enabled state of cellCheck is a convenient flag        //for this status.        if ("Row Selection" == command) {            table.setRowSelectionAllowed(rowCheck.isSelected());            //In MIS mode, column selection allowed must be the            //opposite of row selection allowed.            if (!cellCheck.isEnabled()) {                table.setColumnSelectionAllowed(!rowCheck.isSelected());            }        } else if ("Column Selection" == command) {            table.setColumnSelectionAllowed(columnCheck.isSelected());            //In MIS mode, row selection allowed must be the            //opposite of column selection allowed.            if (!cellCheck.isEnabled()) {                table.setRowSelectionAllowed(!columnCheck.isSelected());            }        } else if ("Cell Selection" == command) {            table.setCellSelectionEnabled(cellCheck.isSelected());        } else if ("Multiple Interval Selection" == command) {             table.setSelectionMode(                    ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);            //If cell selection is on, turn it off.            if (cellCheck.isSelected()) {                cellCheck.setSelected(false);                table.setCellSelectionEnabled(false);            }            //And don't let it be turned back on.            cellCheck.setEnabled(false);        } else if ("Single Interval Selection" == command) {            table.setSelectionMode(                    ListSelectionModel.SINGLE_INTERVAL_SELECTION);            //Cell selection is ok in this mode.            cellCheck.setEnabled(true);        } else if ("Single Selection" == command) {            table.setSelectionMode(                    ListSelectionModel.SINGLE_SELECTION);            //Cell selection is ok in this mode.            cellCheck.setEnabled(true);        }        //Update checkboxes to reflect selection mode side effects.        rowCheck.setSelected(table.getRowSelectionAllowed());        columnCheck.setSelected(table.getColumnSelectionAllowed());        if (cellCheck.isEnabled()) {            cellCheck.setSelected(table.getCellSelectionEnabled());        }    }    private void outputSelection() {        output.append(String.format("Lead: %d, %d. ",                    table.getSelectionModel().getLeadSelectionIndex(),                    table.getColumnModel().getSelectionModel().                        getLeadSelectionIndex()));        output.append("Rows:");        for (int c : table.getSelectedRows()) {            output.append(String.format(" %d", c));        }        output.append(". Columns:");        for (int c : table.getSelectedColumns()) {            output.append(String.format(" %d", c));        }        output.append(".\n");    }    private class RowListener implements ListSelectionListener {        public void valueChanged(ListSelectionEvent event) {            if (event.getValueIsAdjusting()) {                return;            }            output.append("ROW SELECTION EVENT. ");            outputSelection();        }    }    private class ColumnListener implements ListSelectionListener {        public void valueChanged(ListSelectionEvent event) {            if (event.getValueIsAdjusting()) {                return;            }            output.append("COLUMN SELECTION EVENT. ");            outputSelection();        }    }    class MyTableModel extends AbstractTableModel {        private String[] columnNames = {"First Name",                                        "Last Name",                                        "Sport",                                        "# of Years",                                        "Vegetarian"};        private Object[][] data = {            {"Mary", "Campione",             "Snowboarding", new Integer(5), new Boolean(false)},            {"Alison", "Huml",             "Rowing", new Integer(3), new Boolean(true)},            {"Kathy", "Walrath",             "Knitting", new Integer(2), new Boolean(false)},            {"Sharon", "Zakhour",             "Speed reading", new Integer(20), new Boolean(true)},            {"Philip", "Milne",             "Pool", new Integer(10), new Boolean(false)},        };        public int getColumnCount() {            return columnNames.length;        }        public int getRowCount() {            return data.length;        }        public String getColumnName(int col) {            return columnNames[col];        }        public Object getValueAt(int row, int col) {            return data[row][col];        }        /*         * JTable uses this method to determine the default renderer/         * editor for each cell.  If we didn't implement this method,         * then the last column would contain text ("true"/"false"),         * rather than a check box.         */        public Class getColumnClass(int c) {            return getValueAt(0, c).getClass();        }        /*         * Don't need to implement this method unless your table's         * editable.         */        public boolean isCellEditable(int row, int col) {            //Note that the data/cell address is constant,            //no matter where the cell appears onscreen.            if (col < 2) {                return false;            } else {                return true;            }        }        /*         * Don't need to implement this method unless your table's         * data can change.         */        public void setValueAt(Object value, int row, int col) {            data[row][col] = value;            fireTableCellUpdated(row, col);        }    }    /**     * Create the GUI and show it.  For thread safety,     * this method should be invoked from the     * event-dispatching thread.     */    private static void createAndShowGUI() {        //Disable boldface controls.        UIManager.put("swing.boldMetal", Boolean.FALSE);         //Create and set up the window.        JFrame frame = new JFrame("TableSelectionDemo");        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        //Create and set up the content pane.        TableSelectionDemo newContentPane = new TableSelectionDemo();        newContentPane.setOpaque(true); //content panes must be opaque        frame.setContentPane(newContentPane);        //Display the window.        frame.pack();        frame.setVisible(true);    }    public static void main(String[] args) {        //Schedule a job for the event-dispatching thread:        //creating and showing this application's GUI.        javax.swing.SwingUtilities.invokeLater(new Runnable() {            public void run() {                createAndShowGUI();            }        });    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费观看高清完整版在线观看| 一区二区三区欧美日| 天堂资源在线中文精品| 高清beeg欧美| 国产精品蜜臀av| 成人少妇影院yyyy| 亚洲精选在线视频| 欧美日韩精品欧美日韩精品| 日韩中文字幕av电影| 国产精品美女www爽爽爽| 欧美一区二区在线播放| 国产在线视视频有精品| 国产精品麻豆视频| 精品国产91久久久久久久妲己 | 欧美国产综合色视频| 99久久er热在这里只有精品66| 亚洲色图视频网站| 欧美日本精品一区二区三区| 成人成人成人在线视频| 偷窥少妇高潮呻吟av久久免费| 国产精品高潮呻吟| 6080午夜不卡| 国产成人在线视频免费播放| 亚洲综合在线视频| 亚洲丝袜美腿综合| 国产精品午夜免费| 国产清纯白嫩初高生在线观看91| 日本韩国欧美一区| 精品亚洲欧美一区| 亚洲综合色自拍一区| 久久色在线视频| 在线免费观看一区| 国产呦萝稀缺另类资源| 一级中文字幕一区二区| 中文字幕一区三区| 精品国产1区二区| 欧美成人video| 欧美中文字幕一区二区三区亚洲| 99久久精品国产麻豆演员表| av午夜精品一区二区三区| 日本中文字幕一区二区有限公司| 欧美国产精品一区二区三区| 国产女同性恋一区二区| 国产欧美视频一区二区三区| 欧美激情一区二区三区蜜桃视频| 精品不卡在线视频| 久久九九全国免费| 91精品国产综合久久精品图片| 欧美亚州韩日在线看免费版国语版| 国产高清精品在线| 不卡av电影在线播放| 99久久精品一区| 91福利小视频| 欧美精品精品一区| 色香蕉久久蜜桃| 成人小视频在线观看| 成人丝袜高跟foot| 91日韩精品一区| 成人国产精品免费观看视频| 99精品欧美一区二区三区小说 | 亚洲激情欧美激情| 亚洲影院久久精品| 老司机免费视频一区二区| 亚洲福利视频一区二区| 亚洲女性喷水在线观看一区| 久久久精品综合| 久久久久久夜精品精品免费| 国产欧美一区二区精品忘忧草| 中文字幕日韩一区| 亚洲国产综合在线| 人妖欧美一区二区| 青青草97国产精品免费观看| 极品少妇一区二区三区精品视频 | 午夜免费久久看| 免费不卡在线观看| 成人福利视频在线看| 欧美性做爰猛烈叫床潮| 精品国产一区二区三区久久影院| 国产目拍亚洲精品99久久精品| 一区二区三区国产精品| 精品一区二区三区日韩| 99热国产精品| 日韩一区二区精品葵司在线| 欧美日本高清视频在线观看| 欧美xxxxxxxx| 一区二区三区中文字幕电影 | 日韩欧美亚洲另类制服综合在线| 中文字幕精品—区二区四季| 亚洲va在线va天堂| 首页国产丝袜综合| 国产大片一区二区| 欧美日韩国产片| 国产精品久久久久久久久晋中| 午夜电影一区二区三区| www.在线成人| 久久综合九色综合97婷婷 | 日韩国产欧美在线播放| 大胆欧美人体老妇| 日韩欧美三级在线| 一区二区三区资源| 成人黄色一级视频| 日韩欧美高清dvd碟片| 一区二区三区av电影| 国产精品一区免费视频| 成人动漫一区二区在线| 日韩午夜三级在线| 亚洲bdsm女犯bdsm网站| 国产91对白在线观看九色| 欧美一区二区视频在线观看2020| 国产精品久久精品日日| 韩国精品一区二区| 69av一区二区三区| 亚洲国产视频一区二区| 91香蕉视频在线| 中文一区二区完整视频在线观看| 美女脱光内衣内裤视频久久网站| 国产一区二区精品久久91| 欧美日韩成人一区| 午夜精品福利视频网站| 日本韩国精品在线| 中文字幕一区在线观看| 国产成人小视频| 久久久亚洲午夜电影| 精品一区二区精品| 精品久久久久久久久久久院品网| 日韩精品成人一区二区三区| 欧美午夜电影在线播放| 亚洲欧美一区二区三区孕妇| 99re热这里只有精品视频| 国产精品国产三级国产aⅴ中文| 国产宾馆实践打屁股91| 久久先锋影音av鲁色资源| 久久99在线观看| 26uuu精品一区二区在线观看| 蜜臀久久久99精品久久久久久| 欧美精品在欧美一区二区少妇| 亚洲午夜影视影院在线观看| 色哟哟精品一区| 夜夜嗨av一区二区三区| 欧美午夜免费电影| 欧美bbbbb| 欧美成人精精品一区二区频| 精品在线视频一区| 久久久精品中文字幕麻豆发布| 国产精品亚洲一区二区三区妖精| 国产亚洲欧美日韩日本| 国产成人在线视频网址| 中文字幕一区二区日韩精品绯色| 99久久婷婷国产| 亚洲一区二区三区视频在线播放| 欧美性生活大片视频| 日韩成人免费在线| 欧美精品一区视频| 东方aⅴ免费观看久久av| 18欧美乱大交hd1984| 在线免费亚洲电影| 蜜臀av国产精品久久久久 | 欧美激情一区在线| 91久久一区二区| 日韩高清在线不卡| 久久久久久亚洲综合影院红桃| 丁香啪啪综合成人亚洲小说| 亚洲视频你懂的| 欧美日韩在线观看一区二区| 日韩理论电影院| 欧美猛男男办公室激情| 精品一区二区成人精品| 中文字幕日本不卡| 在线电影国产精品| 国产精品资源网站| 亚洲自拍偷拍网站| 久久先锋影音av鲁色资源| 色婷婷综合久久久中文字幕| 蜜桃免费网站一区二区三区| 欧美激情一区二区三区不卡| 精品视频在线免费| 国产福利电影一区二区三区| 一区二区三区91| 久久精品在这里| 欧美日韩日本视频| 国产成a人亚洲| 午夜久久久久久久久| 欧美极品少妇xxxxⅹ高跟鞋| 欧美视频在线一区| 成人禁用看黄a在线| 五月天亚洲精品| 国产精品福利影院| 欧美xingq一区二区| 91国偷自产一区二区三区成为亚洲经典 | 久久久久久久综合色一本| 99精品国产99久久久久久白柏| 全国精品久久少妇| 亚洲三级小视频| 日韩欧美电影一区| 欧美三级电影一区| 成年人网站91| 国产一区欧美一区| 天堂va蜜桃一区二区三区| 国产精品久久久久久亚洲伦| 日韩欧美资源站|