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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? selectiondemo.java

?? jsf、swing的官方指南
?? JAVA
字號(hào):
/*  * SelectionDemo.java requires one other file: *   images/starfield.gif */import javax.swing.BoxLayout;import javax.swing.ImageIcon;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.event.MouseInputAdapter;import java.awt.*;import java.awt.event.MouseEvent;/*  * This displays an image.  When the user drags within * the image, this program displays a rectangle and a string * indicating the bounds of the rectangle. */public class SelectionDemo {    JLabel label;    static String starFile = "images/starfield.gif";        private void buildUI(Container container, ImageIcon image) {        container.setLayout(new BoxLayout(container,                                          BoxLayout.PAGE_AXIS));                                                  SelectionArea area = new SelectionArea(image, this);        container.add(area);        label = new JLabel("Drag within the image.");        label.setLabelFor(area);        container.add(label);        //Align the left edges of the components.        area.setAlignmentX(Component.LEFT_ALIGNMENT);        label.setAlignmentX(Component.LEFT_ALIGNMENT); //redundant    }    public void updateLabel(Rectangle rect) {        int width = rect.width;        int height = rect.height;        //Make the coordinates look OK if a dimension is 0.        if (width == 0) {            width = 1;        }        if (height == 0) {            height = 1;        }        label.setText("Rectangle goes from ("                      + rect.x + ", " + rect.y + ") to ("                      + (rect.x + width - 1) + ", "                      + (rect.y + height - 1) + ").");    }    /** Returns an ImageIcon, or null if the path was invalid. */    protected static ImageIcon createImageIcon(String path) {        java.net.URL imgURL = SelectionDemo.class.getResource(path);        if (imgURL != null) {            return new ImageIcon(imgURL);        } else {            System.err.println("Couldn't find file: " + path);            return null;        }    }    /**     * Create the GUI and show it.  For thread safety,      * this method should be invoked from the      * event-dispatching thread.     */    private static void createAndShowGUI() {        //Create and set up the window.        JFrame frame = new JFrame("SelectionDemo");        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        //Set up the content pane.        SelectionDemo controller = new SelectionDemo();        controller.buildUI(frame.getContentPane(),                           createImageIcon(starFile));        //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();             }        });    }        private class SelectionArea extends JLabel {        Rectangle currentRect = null;        Rectangle rectToDraw = null;        Rectangle previousRectDrawn = new Rectangle();        SelectionDemo controller;            public SelectionArea(ImageIcon image, SelectionDemo controller) {            super(image); //This component displays an image.            this.controller = controller;            setOpaque(true);            setMinimumSize(new Dimension(10,10)); //don't hog space                MyListener myListener = new MyListener();            addMouseListener(myListener);            addMouseMotionListener(myListener);        }            private class MyListener extends MouseInputAdapter {            public void mousePressed(MouseEvent e) {                int x = e.getX();                int y = e.getY();                currentRect = new Rectangle(x, y, 0, 0);                updateDrawableRect(getWidth(), getHeight());                repaint();            }                public void mouseDragged(MouseEvent e) {                updateSize(e);            }                public void mouseReleased(MouseEvent e) {                updateSize(e);            }                /*              * Update the size of the current rectangle             * and call repaint.  Because currentRect             * always has the same origin, translate it             * if the width or height is negative.             *              * For efficiency (though             * that isn't an issue for this program),             * specify the painting region using arguments             * to the repaint() call.             *              */            void updateSize(MouseEvent e) {                int x = e.getX();                int y = e.getY();                currentRect.setSize(x - currentRect.x,                                    y - currentRect.y);                updateDrawableRect(getWidth(), getHeight());                Rectangle totalRepaint = rectToDraw.union(previousRectDrawn);                repaint(totalRepaint.x, totalRepaint.y,                        totalRepaint.width, totalRepaint.height);            }        }            protected void paintComponent(Graphics g) {            super.paintComponent(g); //paints the background and image                //If currentRect exists, paint a box on top.            if (currentRect != null) {                //Draw a rectangle on top of the image.                g.setXORMode(Color.white); //Color of line varies                                           //depending on image colors                g.drawRect(rectToDraw.x, rectToDraw.y,                            rectToDraw.width - 1, rectToDraw.height - 1);                    controller.updateLabel(rectToDraw);            }        }            private void updateDrawableRect(int compWidth, int compHeight) {            int x = currentRect.x;            int y = currentRect.y;            int width = currentRect.width;            int height = currentRect.height;                //Make the width and height positive, if necessary.            if (width < 0) {                width = 0 - width;                x = x - width + 1;                 if (x < 0) {                    width += x;                     x = 0;                }            }            if (height < 0) {                height = 0 - height;                y = y - height + 1;                 if (y < 0) {                    height += y;                     y = 0;                }            }                //The rectangle shouldn't extend past the drawing area.            if ((x + width) > compWidth) {                width = compWidth - x;            }            if ((y + height) > compHeight) {                height = compHeight - y;            }                      //Update rectToDraw after saving old value.            if (rectToDraw != null) {                previousRectDrawn.setBounds(                            rectToDraw.x, rectToDraw.y,                             rectToDraw.width, rectToDraw.height);                rectToDraw.setBounds(x, y, width, height);            } else {                rectToDraw = new Rectangle(x, y, width, height);            }        }    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天性综合| 亚洲成人动漫一区| 欧美日韩国产精品成人| 大陆成人av片| 国产成人免费视频网站高清观看视频 | 91国产精品成人| 成人一区在线观看| 成人免费观看视频| hitomi一区二区三区精品| 成人一级片网址| 不卡av免费在线观看| 波多野结衣在线aⅴ中文字幕不卡| 国产精品一区二区在线观看网站| 国产乱人伦偷精品视频免下载| 狠狠色综合日日| 国产精品影视在线| 成人av综合一区| 成人av网址在线观看| 99久久综合狠狠综合久久| 99国产精品视频免费观看| 99久久精品费精品国产一区二区| 97国产一区二区| 欧美性淫爽ww久久久久无| 欧美精品 日韩| 久久在线观看免费| 国产精品久99| 亚洲高清免费观看 | 欧美色爱综合网| 欧美日本一道本| 久久综合狠狠综合| 亚洲人吸女人奶水| 日本视频在线一区| 国产成人日日夜夜| 欧美亚洲高清一区| 日韩欧美一级在线播放| 日本一二三四高清不卡| 一片黄亚洲嫩模| 黄色日韩三级电影| 色八戒一区二区三区| 欧美一区三区二区| 国产精品亲子乱子伦xxxx裸| 亚洲一区二区欧美| 极品美女销魂一区二区三区 | 亚洲欧洲99久久| 亚洲成av人片在线| 懂色一区二区三区免费观看| 欧美亚洲愉拍一区二区| 久久久高清一区二区三区| 亚洲国产欧美在线| 国产真实乱对白精彩久久| 在线观看亚洲专区| 欧美国产日韩a欧美在线观看| 亚洲成人在线免费| 暴力调教一区二区三区| 日韩欧美中文一区二区| 亚洲一区二区三区在线看| 国产在线精品免费| 777奇米四色成人影色区| 成人欧美一区二区三区黑人麻豆| 激情另类小说区图片区视频区| 日本高清不卡aⅴ免费网站| 久久这里只有精品视频网| 午夜不卡av免费| 色成人在线视频| 国产精品丝袜黑色高跟| 国内不卡的二区三区中文字幕| 欧美日本国产视频| 亚洲午夜国产一区99re久久| 大白屁股一区二区视频| 久久久久久久久久美女| 蜜桃av一区二区| 精品久久久久久久久久久久久久久| 亚洲精品国产无套在线观| voyeur盗摄精品| 欧美韩国日本一区| 国产.欧美.日韩| 国产日韩欧美一区二区三区乱码| 日韩影院精彩在线| 91精品久久久久久久99蜜桃| 亚洲五月六月丁香激情| 91官网在线观看| 亚洲综合一二三区| 欧美午夜精品理论片a级按摩| 亚洲精品成人在线| 欧美最新大片在线看| 一区二区三区在线视频免费| 91黄色激情网站| 亚洲国产欧美在线| 日韩欧美一级特黄在线播放| 美腿丝袜在线亚洲一区| 欧美不卡激情三级在线观看| 久久国产生活片100| 久久亚洲免费视频| www.性欧美| 亚洲尤物在线视频观看| 欧美精品久久久久久久多人混战| 日韩二区三区四区| 精品国产一区a| 成人污污视频在线观看| 亚洲桃色在线一区| 欧美日韩黄色一区二区| 久久精品免费观看| 国产欧美综合色| 一本色道a无线码一区v| 亚洲成人一区二区| 欧美不卡激情三级在线观看| 国产99久久精品| 一区二区三区美女视频| 欧美一区二区三区四区高清| 国产老妇另类xxxxx| 中文字幕综合网| 91精品婷婷国产综合久久 | 久久婷婷综合激情| 99热国产精品| 美女网站色91| 国产精品国产三级国产a| 欧美日韩精品一二三区| 国产精品 欧美精品| 一区二区三区.www| 日韩欧美成人激情| 色综合欧美在线视频区| 久久精品99国产精品日本| 国产精品美女久久久久久久久| 欧美日韩免费电影| 成人精品免费网站| 久久精品国产网站| 一区二区三区不卡在线观看 | av亚洲精华国产精华| 五月激情丁香一区二区三区| 中文无字幕一区二区三区| 欧美精品丝袜中出| 色哟哟国产精品免费观看| 久久99国产精品久久99| 亚洲成人自拍偷拍| 自拍视频在线观看一区二区| 精品国内片67194| 欧美三级中文字幕| 91老师国产黑色丝袜在线| 国产一区欧美日韩| 免费久久99精品国产| 亚洲自拍偷拍网站| 亚洲视频资源在线| 国产精品女人毛片| 久久综合中文字幕| 日韩亚洲欧美中文三级| 欧美日韩一区二区三区不卡| 99久久精品国产精品久久| 成人免费高清在线| 国产成人亚洲综合a∨猫咪| 欧美bbbbb| 青青草原综合久久大伊人精品优势| 亚洲欧美电影一区二区| 亚洲图片另类小说| 国产精品家庭影院| 欧美高清一级片在线观看| 国产女人aaa级久久久级| 国产网站一区二区| 久久久精品免费观看| 国产欧美日韩另类一区| 久久久另类综合| 久久久精品人体av艺术| 亚洲国产精品国自产拍av| 国产精品色在线| 国产精品久久久久久亚洲毛片 | ...xxx性欧美| 亚洲色图在线播放| 亚洲精品国产无套在线观| 一区二区三区高清| 性做久久久久久久久| 香蕉成人啪国产精品视频综合网| 亚洲自拍与偷拍| 日韩精品久久理论片| 蜜乳av一区二区| 国产suv精品一区二区6| 成人午夜在线播放| 色综合天天综合色综合av | 亚洲成av人片在线观看| 日韩精品电影一区亚洲| 九一九一国产精品| 成人免费高清视频在线观看| 9i看片成人免费高清| 欧美影院一区二区三区| 91麻豆精品国产91久久久资源速度 | 国产伦理精品不卡| 欧美影院一区二区三区| 欧美猛男gaygay网站| 久久香蕉国产线看观看99| 亚洲欧洲精品一区二区三区不卡| 一区二区国产视频| 国产一区在线观看麻豆| 色呦呦日韩精品| 欧美大黄免费观看| 成人欧美一区二区三区白人| 水蜜桃久久夜色精品一区的特点| 久久激五月天综合精品| 色伊人久久综合中文字幕| 日韩一区二区三区四区五区六区| 国产精品视频线看| 日韩av在线免费观看不卡| 成人午夜在线视频|