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

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

?? framedemo2.java

?? jsf、swing的官方指南
?? JAVA
字號:
import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.awt.image.BufferedImage;/* * FrameDemo2.java shows off the window decoration features added in * 1.4, plus some window positioning code and (optionally) * setIconImage. It uses the file images/FD.jpg. */public class FrameDemo2 extends WindowAdapter                        implements ActionListener {    private Point lastLocation = null;    private int maxX = 500;    private int maxY = 500;    //the main frame's default button    private static JButton defaultButton = null;    //constants for action commands    protected final static String NO_DECORATIONS = "no_dec";    protected final static String LF_DECORATIONS = "laf_dec";    protected final static String WS_DECORATIONS = "ws_dec";    protected final static String CREATE_WINDOW = "new_win";    protected final static String DEFAULT_ICON = "def_icon";    protected final static String FILE_ICON = "file_icon";    protected final static String PAINT_ICON = "paint_icon";    //true if the next frame created should have no window decorations    protected boolean noDecorations = false;    //true if the next frame created should have setIconImage called    protected boolean specifyIcon = false;    //true if the next frame created should have a custom painted icon    protected boolean createIcon = false;    //Perform some initialization.    public FrameDemo2() {        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();        maxX = screenSize.width - 50;        maxY = screenSize.height - 50;    }    //Create a new MyFrame object and show it.    public void showNewWindow() {        JFrame frame = new MyFrame();        //Take care of the no window decorations case.        //NOTE: Unless you really need the functionality        //provided by JFrame, you would usually use a        //Window or JWindow instead of an undecorated JFrame.        if (noDecorations) {            frame.setUndecorated(true);        }        //Set window location.        if (lastLocation != null) {            //Move the window over and down 40 pixels.            lastLocation.translate(40, 40);            if ((lastLocation.x > maxX) || (lastLocation.y > maxY)) {                lastLocation.setLocation(0, 0);            }            frame.setLocation(lastLocation);        } else {            lastLocation = frame.getLocation();        }        //Calling setIconImage sets the icon displayed when the window        //is minimized.  Most window systems (or look and feels, if        //decorations are provided by the look and feel) also use this        //icon in the window decorations.        if (specifyIcon) {            if (createIcon) {                frame.setIconImage(createFDImage()); //create an icon from scratch            } else {                frame.setIconImage(getFDImage());    //get the icon from a file            }        }        //Show window.        frame.setSize(new Dimension(170, 100));        frame.setVisible(true);    }    // Create the window-creation controls that go in the main window.    protected JComponent createOptionControls() {        JLabel label1 = new JLabel("Decoration options for subsequently created frames:");        ButtonGroup bg1 = new ButtonGroup();        JLabel label2 = new JLabel("Icon options:");        ButtonGroup bg2 = new ButtonGroup();        //Create the buttons        JRadioButton rb1 = new JRadioButton();        rb1.setText("Look and feel decorated");        rb1.setActionCommand(LF_DECORATIONS);        rb1.addActionListener(this);        rb1.setSelected(true);        bg1.add(rb1);        //        JRadioButton rb2 = new JRadioButton();        rb2.setText("Window system decorated");        rb2.setActionCommand(WS_DECORATIONS);        rb2.addActionListener(this);        bg1.add(rb2);        //        JRadioButton rb3 = new JRadioButton();        rb3.setText("No decorations");        rb3.setActionCommand(NO_DECORATIONS);        rb3.addActionListener(this);        bg1.add(rb3);        //        //        JRadioButton rb4 = new JRadioButton();        rb4.setText("Default icon");        rb4.setActionCommand(DEFAULT_ICON);        rb4.addActionListener(this);        rb4.setSelected(true);        bg2.add(rb4);        //        JRadioButton rb5 = new JRadioButton();        rb5.setText("Icon from a JPEG file");        rb5.setActionCommand(FILE_ICON);        rb5.addActionListener(this);        bg2.add(rb5);        //        JRadioButton rb6 = new JRadioButton();        rb6.setText("Painted icon");        rb6.setActionCommand(PAINT_ICON);        rb6.addActionListener(this);        bg2.add(rb6);        //Add everything to a container.        Box box = Box.createVerticalBox();        box.add(label1);        box.add(Box.createVerticalStrut(5)); //spacer        box.add(rb1);        box.add(rb2);        box.add(rb3);        //        box.add(Box.createVerticalStrut(15)); //spacer        box.add(label2);        box.add(Box.createVerticalStrut(5)); //spacer        box.add(rb4);        box.add(rb5);        box.add(rb6);        //Add some breathing room.        box.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));        return box;    }    //Create the button that goes in the main window.    protected JComponent createButtonPane() {        JButton button = new JButton("New window");        button.setActionCommand(CREATE_WINDOW);        button.addActionListener(this);        defaultButton = button; //Used later to make this the frame's default button.        //Center the button in a panel with some space around it.        JPanel pane = new JPanel(); //use default FlowLayout        pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));        pane.add(button);        return pane;    }    //Handle action events from all the buttons.    public void actionPerformed(ActionEvent e) {        String command = e.getActionCommand();        //Handle the New window button.        if (CREATE_WINDOW.equals(command)) {            showNewWindow();        //Handle the first group of radio buttons.        } else if (NO_DECORATIONS.equals(command)) {            noDecorations = true;            JFrame.setDefaultLookAndFeelDecorated(false);        } else if (WS_DECORATIONS.equals(command)) {            noDecorations = false;            JFrame.setDefaultLookAndFeelDecorated(false);        } else if (LF_DECORATIONS.equals(command)) {            noDecorations = false;            JFrame.setDefaultLookAndFeelDecorated(true);        //Handle the second group of radio buttons.        } else if (DEFAULT_ICON.equals(command)) {            specifyIcon = false;        } else if (FILE_ICON.equals(command)) {            specifyIcon = true;            createIcon = false;        } else if (PAINT_ICON.equals(command)) {            specifyIcon = true;            createIcon = true;        }    }    //Creates an icon-worthy Image from scratch.    protected static Image createFDImage() {        //Create a 16x16 pixel image.        BufferedImage bi = new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB);        //Draw into it.        Graphics g = bi.getGraphics();        g.setColor(Color.BLACK);        g.fillRect(0, 0, 15, 15);        g.setColor(Color.RED);        g.fillOval(5, 3, 6, 6);        //Clean up.        g.dispose();        //Return it.        return bi;    }    //Returns an Image or null.    protected static Image getFDImage() {        java.net.URL imgURL = FrameDemo2.class.getResource("images/FD.jpg");        if (imgURL != null) {            return new ImageIcon(imgURL).getImage();        } else {            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() {        //Use the Java look and feel.        try {            UIManager.setLookAndFeel(                UIManager.getCrossPlatformLookAndFeelClassName());        } catch (Exception e) { }        //Make sure we have nice window decorations.        JFrame.setDefaultLookAndFeelDecorated(true);        JDialog.setDefaultLookAndFeelDecorated(true);        //Instantiate the controlling class.        JFrame frame = new JFrame("FrameDemo2");        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        //Create and set up the content pane.        FrameDemo2 demo = new FrameDemo2();        //Add components to it.        Container contentPane = frame.getContentPane();        contentPane.add(demo.createOptionControls(),                        BorderLayout.CENTER);        contentPane.add(demo.createButtonPane(),                        BorderLayout.PAGE_END);        frame.getRootPane().setDefaultButton(defaultButton);        //Display the window.        frame.pack();        frame.setLocationRelativeTo(null); //center it        frame.setVisible(true);    }    //Start the demo.    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();            }        });    }    class MyFrame extends JFrame implements ActionListener {        //Create a frame with a button.        public MyFrame() {            super("A window");            setDefaultCloseOperation(DISPOSE_ON_CLOSE);            //This button lets you close even an undecorated window.            JButton button = new JButton("Close window");            button.addActionListener(this);            //Place the button near the bottom of the window.            Container contentPane = getContentPane();            contentPane.setLayout(new BoxLayout(contentPane,                                                BoxLayout.PAGE_AXIS));            contentPane.add(Box.createVerticalGlue()); //takes all extra space            contentPane.add(button);            button.setAlignmentX(Component.CENTER_ALIGNMENT); //horizontally centered            contentPane.add(Box.createVerticalStrut(5)); //spacer        }        //Make the button do the same thing as the default close operation        //(DISPOSE_ON_CLOSE).        public void actionPerformed(ActionEvent e) {            setVisible(false);            dispose();        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久福利资源站| 亚洲1区2区3区视频| 欧美一区二区三区影视| 色网站国产精品| 不卡高清视频专区| av电影在线不卡| 91女人视频在线观看| 99久久er热在这里只有精品15| 国产成人精品免费在线| 国v精品久久久网| 成人国产精品视频| av成人动漫在线观看| 99久久精品费精品国产一区二区| 国产成人在线免费观看| 国产不卡一区视频| 成人av免费观看| 一道本成人在线| 欧美影院精品一区| 91精品国产综合久久国产大片| 欧美精品三级在线观看| 日韩亚洲欧美一区| 久久久久久久精| 日韩毛片视频在线看| 亚洲免费电影在线| 日av在线不卡| 国产99久久精品| 精品视频1区2区3区| 欧美特级限制片免费在线观看| 欧美日韩国产一级| 26uuu欧美| 亚洲精品久久7777| 免费成人在线观看| 成人网在线播放| 欧美吻胸吃奶大尺度电影| 日韩一区二区三区视频| 国产精品视频一二三区| 天天影视涩香欲综合网| 国产一区三区三区| 在线观看av一区二区| 久久综合五月天婷婷伊人| 中文字幕一区二区三区视频| 日韩电影一区二区三区四区| 国产xxx精品视频大全| 欧美四级电影在线观看| 国产日韩欧美电影| 亚洲电影视频在线| 国产成人aaa| 91精品国产乱码久久蜜臀| 国产精品女主播av| 久久99久国产精品黄毛片色诱| 成人免费精品视频| 精品国产污网站| 亚洲成人激情av| 成人18视频日本| 精品国免费一区二区三区| 一区二区三国产精华液| 国产99久久久精品| 2024国产精品| 日本vs亚洲vs韩国一区三区| 日本乱人伦aⅴ精品| 国产日韩欧美综合一区| 蓝色福利精品导航| 欧美人成免费网站| 亚洲综合视频网| 91在线国内视频| 国产精品伦理在线| 国产精一品亚洲二区在线视频| 久久综合狠狠综合久久激情| 一区二区三区在线视频观看| 成人h精品动漫一区二区三区| 欧美不卡123| 日韩av在线发布| 欧美日韩一区二区在线视频| 亚洲欧美综合在线精品| 成人av资源下载| 国产欧美视频在线观看| 国产成人啪免费观看软件| 欧美一区国产二区| 青青草成人在线观看| 欧美高清精品3d| 日韩和欧美一区二区三区| 欧美另类高清zo欧美| 日韩极品在线观看| 日韩精品专区在线影院重磅| 美女尤物国产一区| 精品乱人伦一区二区三区| 极品少妇一区二区| 精品久久久久99| 国产揄拍国内精品对白| 国产女人18毛片水真多成人如厕 | 欧美亚洲国产bt| 伊人婷婷欧美激情| 欧美色区777第一页| 首页国产欧美日韩丝袜| 欧美一卡二卡在线观看| 久久疯狂做爰流白浆xx| 国产亚洲综合在线| 在线观看网站黄不卡| 一区二区三区波多野结衣在线观看| 在线观看91视频| 蜜桃久久久久久| 久久精品这里都是精品| www.欧美精品一二区| 亚洲国产精品久久一线不卡| 91麻豆精品国产91久久久| 久久精品国产第一区二区三区| 国产三级一区二区三区| 欧美专区在线观看一区| 美女高潮久久久| 最好看的中文字幕久久| 制服丝袜亚洲网站| 不卡的av电影在线观看| 午夜视频一区二区三区| 久久久久久久久久久电影| 日本韩国精品在线| 国产一区二区在线视频| 一区二区三区成人| 久久精品视频在线免费观看| 欧美在线小视频| 国产99久久久国产精品潘金 | 日韩免费成人网| 97久久超碰精品国产| 蜜桃视频一区二区三区在线观看 | 一区二区三区免费观看| 精品少妇一区二区三区在线视频| 91蝌蚪porny| 国产一区二区三区四区在线观看| 亚洲在线一区二区三区| 中文字幕不卡在线观看| 精品剧情在线观看| 欧美日韩视频专区在线播放| 白白色亚洲国产精品| 国产一区二区主播在线| 日韩精品午夜视频| 亚洲宅男天堂在线观看无病毒| 久久一区二区视频| 日韩一区二区视频| 欧美日本高清视频在线观看| 一本一道综合狠狠老| 成人涩涩免费视频| 国产一区视频网站| 久久av中文字幕片| 另类调教123区| 日本色综合中文字幕| 五月天一区二区三区| 亚洲国产cao| 亚洲高清一区二区三区| 一区二区日韩电影| 亚洲一区免费视频| 一区二区三区四区视频精品免费 | 26uuu亚洲| 精品区一区二区| 精品久久免费看| 精品日韩一区二区三区免费视频| 91精品国产欧美一区二区成人| 欧美在线不卡视频| 欧美日韩另类一区| 欧美精品 国产精品| 91精品国产欧美日韩| 日韩精品一区二区三区蜜臀| 日韩欧美一区电影| 26uuu精品一区二区在线观看| 欧美一个色资源| 精品成人在线观看| 久久精品欧美一区二区三区不卡 | 91麻豆自制传媒国产之光| 99国产精品久久久久| 一本一道综合狠狠老| 欧美伦理影视网| 精品国精品自拍自在线| 久久综合色播五月| 国产精品美女www爽爽爽| 亚洲视频小说图片| 亚洲国产成人va在线观看天堂| 热久久一区二区| 国产精品资源在线看| 91欧美一区二区| 91精品国产一区二区三区| 欧美精品一区二区三区一线天视频| 久久精品人人爽人人爽| 一个色在线综合| 久久精品久久99精品久久| 国产成人啪免费观看软件| 色8久久人人97超碰香蕉987| 欧美电影在线免费观看| 久久久久九九视频| 亚洲一区二区三区国产| 精品一区中文字幕| 色综合久久久久综合99| 91麻豆精品国产91久久久久 | 91精品办公室少妇高潮对白| 欧美精选一区二区| 国产精品网站在线观看| 亚洲不卡在线观看| 成人免费视频网站在线观看| 欧美日韩精品一区视频| 久久久久久久综合日本| 亚洲成人免费电影| 国产不卡免费视频| 日韩欧美中文一区二区|