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

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

?? selectiondemo.java

?? 初期JAVA學習非常有用的資料。幫助深入了解API。特別是Applet。
?? JAVA
字號:
/* * 1.1 Swing version. */import javax.swing.*;import javax.swing.border.Border;import javax.swing.event.*;import java.awt.*;import java.awt.event.*;/*  * This displays a framed area.  When the user drags within * the area, this program displays a rectangle and a string * indicating the bounds of the rectangle. */public class SelectionDemo extends JApplet {    JLabel label;    static String starFile = "images/starfield.gif";    //Called only when this is run as an applet.    public void init() {        ImageIcon image = new ImageIcon(getImage(getCodeBase(),                                                 starFile));        buildUI(getContentPane(), image);    }    void buildUI(Container container, ImageIcon image) {        container.setLayout(new BoxLayout(container,                                          BoxLayout.Y_AXIS));        JPanel framedArea = frameItUp(new SelectionArea(image, this));        container.add(framedArea);        label = new JLabel("Drag within the framed area.");        container.add(label);        //Align the left edges of the components.        framedArea.setAlignmentX(LEFT_ALIGNMENT);        label.setAlignmentX(LEFT_ALIGNMENT); //redundant    }    JPanel frameItUp(Component insides) {        Border raisedBevel, loweredBevel, compound;        raisedBevel = BorderFactory.createRaisedBevelBorder();        loweredBevel = BorderFactory.createLoweredBevelBorder();        compound = BorderFactory.createCompoundBorder                        (raisedBevel, loweredBevel);        JPanel framedArea = new JPanel();        framedArea.setBorder(compound);        framedArea.setLayout(new GridLayout(1,0));        framedArea.add(insides);        return framedArea;    }    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) + ").");    }    public static void main(String[] args) {        JFrame f = new JFrame("SelectionDemo");        f.addWindowListener(new WindowAdapter() {            public void windowClosing(WindowEvent e) {                System.exit(0);            }        });        SelectionDemo controller = new SelectionDemo();        controller.buildUI(f.getContentPane(),                           new ImageIcon(starFile));        f.pack();        f.setVisible(true);    }}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);    }    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);        }    }    public 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.// XXX: We used to use XOR mode, but in 1.2, due to bugs 4188795// XXX: and 4219548, that causes an off-by-one error.            //g.setXORMode(Color.white); //Color of line varies                                         //depending on image colors	    g.setColor(Color.white);            g.drawRect(rectToDraw.x, rectToDraw.y,                        rectToDraw.width - 1, rectToDraw.height - 1);            controller.updateLabel(rectToDraw);        }    }    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);        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人成精品久久久久| 欧美一区2区视频在线观看| 国产人久久人人人人爽| 国产精品系列在线播放| 中文字幕欧美区| 91在线观看免费视频| 亚洲一区二区三区中文字幕 | 欧美一区二区精美| 国产精品色一区二区三区| 亚洲黄色小说网站| 在线亚洲欧美专区二区| 亚洲国产sm捆绑调教视频| 国产精品国产三级国产普通话蜜臀| 懂色av噜噜一区二区三区av| 国产精品福利在线播放| 欧美三日本三级三级在线播放| 奇米精品一区二区三区在线观看一| 欧美精品一区二区三区视频| 成人福利视频在线看| 亚洲一区二区三区在线播放| 日韩一级完整毛片| 成人av在线资源网| 视频在线观看一区| 日本一区二区视频在线观看| 91精品福利视频| 狠狠网亚洲精品| 亚洲精品国产a久久久久久 | 亚洲一区二区视频在线| 精品三级在线看| 一本到高清视频免费精品| 日本中文在线一区| 成人欧美一区二区三区| 日韩限制级电影在线观看| 91在线小视频| 极品少妇一区二区三区精品视频| 亚洲精品成人悠悠色影视| 欧美不卡视频一区| 欧美色综合影院| 国产成人av在线影院| 天天av天天翘天天综合网| 中文字幕av一区二区三区| 7777精品伊人久久久大香线蕉的 | 亚洲精品乱码久久久久| 久久综合久久久久88| 欧美性色欧美a在线播放| 国产成人精品www牛牛影视| 日本系列欧美系列| 亚洲精品久久嫩草网站秘色| 国产婷婷色一区二区三区| 91精品在线观看入口| 91同城在线观看| 国产成人av一区二区三区在线| 丝袜美腿高跟呻吟高潮一区| 亚洲精品菠萝久久久久久久| 国产色一区二区| 精品国产成人系列| 欧美日韩不卡一区二区| 91成人免费电影| 91麻豆精品国产91久久久| 91福利视频在线| 97久久人人超碰| 成人综合婷婷国产精品久久蜜臀 | 99九九99九九九视频精品| 国产麻豆精品久久一二三| 美女国产一区二区| 偷拍一区二区三区| 午夜精品久久久久| 亚洲一区二区五区| 亚洲欧美另类小说| 亚洲人成7777| 亚洲黄网站在线观看| 亚洲欧美一区二区三区国产精品| 久久精品亚洲国产奇米99| 精品久久久久久久久久久院品网 | 日本韩国欧美一区二区三区| 不卡电影一区二区三区| 成人免费精品视频| 成人精品视频一区| www.66久久| 97久久精品人人做人人爽| 99re这里只有精品视频首页| 91玉足脚交白嫩脚丫在线播放| 国产a区久久久| 99热99精品| 在线亚洲免费视频| 欧美日韩一级二级三级| 日韩一区二区三区四区| 日韩欧美色电影| 久久久天堂av| 国产精品欧美久久久久一区二区| 中文字幕一区av| 亚洲影院理伦片| 日韩av在线发布| 国产做a爰片久久毛片| 国产传媒日韩欧美成人| 99久久久久免费精品国产 | 欧美日韩视频专区在线播放| 91福利国产成人精品照片| |精品福利一区二区三区| **欧美大码日韩| 亚洲第一搞黄网站| 精久久久久久久久久久| 懂色av一区二区三区蜜臀| 在线视频综合导航| 日韩欧美区一区二| 国产精品电影院| 天天免费综合色| 国产一区二区精品久久99| 波多野结衣在线一区| 欧美日韩在线精品一区二区三区激情| 日韩一区二区三区精品视频| 国产日韩欧美综合一区| 亚洲美女免费视频| 乱中年女人伦av一区二区| 国产精品白丝jk白祙喷水网站| 91小宝寻花一区二区三区| 91精品一区二区三区久久久久久| 国产亚洲女人久久久久毛片| 亚洲一级电影视频| 国产激情偷乱视频一区二区三区| 色偷偷88欧美精品久久久| 欧美大片一区二区| 亚洲另类一区二区| 黑人巨大精品欧美黑白配亚洲| 一本色道**综合亚洲精品蜜桃冫| 日韩三级av在线播放| 亚洲欧美韩国综合色| 久久99精品久久久| 欧美日韩亚洲另类| 国产精品久久777777| 久久国产三级精品| 欧美网站一区二区| 欧美激情一区二区在线| 免费av网站大全久久| 色网站国产精品| 国产性做久久久久久| 日本美女一区二区三区| 日本高清不卡在线观看| 国产丝袜美腿一区二区三区| 日韩中文字幕区一区有砖一区| 99vv1com这只有精品| 国产亚洲欧美中文| 免费成人在线视频观看| 欧美日韩中文字幕一区| 一区在线中文字幕| 成人性生交大片免费看视频在线 | 久久看人人爽人人| 日日欢夜夜爽一区| 精品国产青草久久久久福利| 亚洲国产成人av网| 色94色欧美sute亚洲线路一久| 欧美国产97人人爽人人喊| 国产精品一区专区| 精品国产欧美一区二区| 美女www一区二区| 欧美一区二区三区婷婷月色| 亚洲乱码中文字幕| 91免费在线看| 自拍偷拍欧美精品| 91在线porny国产在线看| 国产精品色眯眯| 成人app网站| 久久精品一级爱片| 国产999精品久久| 欧美国产精品劲爆| 99久久er热在这里只有精品66| 亚洲国产高清aⅴ视频| 成人免费看黄yyy456| 国产精品三级av| 91麻豆精东视频| 亚洲精品中文在线| 欧美性猛片xxxx免费看久爱| 夜夜嗨av一区二区三区中文字幕| 91美女在线看| 亚洲一区二区成人在线观看| 91黄视频在线| 亚洲成人久久影院| 欧美一级日韩不卡播放免费| 久久国产尿小便嘘嘘尿| 26uuu色噜噜精品一区| 国产成人精品综合在线观看| 国产精品福利电影一区二区三区四区| av中文字幕一区| 亚洲综合自拍偷拍| 69久久夜色精品国产69蝌蚪网| 毛片不卡一区二区| 国产视频在线观看一区二区三区| 成人一二三区视频| 亚洲最大成人综合| 日韩欧美美女一区二区三区| 精品一区二区日韩| 中文字幕亚洲一区二区av在线 | 国产福利电影一区二区三区| 日韩精品免费视频人成| 欧美精品一区二区三区很污很色的| 国产九色精品成人porny| 亚洲人成在线播放网站岛国| 欧美精品在欧美一区二区少妇| 国内不卡的二区三区中文字幕| 中文字幕一区二区三区蜜月 |