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

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

?? textsamplerdemo.java

?? Java樣例程序集合:2D
?? JAVA
字號:
/* * Swing Version */import javax.swing.*;import javax.swing.text.*;import java.awt.*;              //for layout managersimport java.awt.event.*;        //for action and window eventsimport java.net.URL;import java.io.IOException;public class TextSamplerDemo extends JFrame                             implements ActionListener {    private String newline = "\n";    protected static final String textFieldString = "JTextField";    protected static final String passwordFieldString = "JPasswordField";    protected JLabel actionLabel;    public TextSamplerDemo() {        super("TextSamplerDemo");        //Create a regular text field.        JTextField textField = new JTextField(10);        textField.setActionCommand(textFieldString);        textField.addActionListener(this);        //Create a password field.        JPasswordField passwordField = new JPasswordField(10);        passwordField.setActionCommand(passwordFieldString);        passwordField.addActionListener(this);        //Create some labels for the fields.        JLabel textFieldLabel = new JLabel(textFieldString + ": ");        textFieldLabel.setLabelFor(textField);        JLabel passwordFieldLabel = new JLabel(passwordFieldString + ": ");        passwordFieldLabel.setLabelFor(passwordField);        //Create a label to put messages during an action event.        actionLabel = new JLabel("Type text and then Return in a field.");	actionLabel.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));        //Lay out the text controls and the labels.        JPanel textControlsPane = new JPanel();        GridBagLayout gridbag = new GridBagLayout();        GridBagConstraints c = new GridBagConstraints();        textControlsPane.setLayout(gridbag);        JLabel[] labels = {textFieldLabel, passwordFieldLabel};        JTextField[] textFields = {textField, passwordField};        addLabelTextRows(labels, textFields, gridbag, textControlsPane);        c.gridwidth = GridBagConstraints.REMAINDER; //last        c.anchor = GridBagConstraints.WEST;        c.weightx = 1.0;        gridbag.setConstraints(actionLabel, c);        textControlsPane.add(actionLabel);        textControlsPane.setBorder(                BorderFactory.createCompoundBorder(                                BorderFactory.createTitledBorder("Text Fields"),                                BorderFactory.createEmptyBorder(5,5,5,5)));        //Create a text area.        JTextArea textArea = new JTextArea(                "This is an editable JTextArea " +                "that has been initialized with the setText method. " +                "A text area is a \"plain\" text component, " +                "which means that although it can display text " +                "in any font, all of the text is in the same font."        );        textArea.setFont(new Font("Serif", Font.ITALIC, 16));        textArea.setLineWrap(true);        textArea.setWrapStyleWord(true);        JScrollPane areaScrollPane = new JScrollPane(textArea);        areaScrollPane.setVerticalScrollBarPolicy(                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);        areaScrollPane.setPreferredSize(new Dimension(250, 250));        areaScrollPane.setBorder(            BorderFactory.createCompoundBorder(                BorderFactory.createCompoundBorder(                                BorderFactory.createTitledBorder("Plain Text"),                                BorderFactory.createEmptyBorder(5,5,5,5)),                areaScrollPane.getBorder()));        //Create an editor pane.        JEditorPane editorPane = createEditorPane();        JScrollPane editorScrollPane = new JScrollPane(editorPane);        editorScrollPane.setVerticalScrollBarPolicy(                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);        editorScrollPane.setPreferredSize(new Dimension(250, 145));        editorScrollPane.setMinimumSize(new Dimension(10, 10));        //Create a text pane.        JTextPane textPane = createTextPane();        JScrollPane paneScrollPane = new JScrollPane(textPane);        paneScrollPane.setVerticalScrollBarPolicy(                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);        paneScrollPane.setPreferredSize(new Dimension(250, 155));        paneScrollPane.setMinimumSize(new Dimension(10, 10));        //Put the editor pane and the text pane in a split pane.        JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,                                              editorScrollPane,                                              paneScrollPane);        splitPane.setOneTouchExpandable(true);        JPanel rightPane = new JPanel();        rightPane.add(splitPane);        rightPane.setBorder(BorderFactory.createCompoundBorder(                        BorderFactory.createTitledBorder("Styled Text"),                        BorderFactory.createEmptyBorder(5,5,5,5)));        //Put everything in the applet.        JPanel leftPane = new JPanel();        BoxLayout leftBox = new BoxLayout(leftPane, BoxLayout.Y_AXIS);        leftPane.setLayout(leftBox);        leftPane.add(textControlsPane);        leftPane.add(areaScrollPane);        JPanel contentPane = new JPanel();        BoxLayout box = new BoxLayout(contentPane, BoxLayout.X_AXIS);        contentPane.setLayout(box);        contentPane.add(leftPane);        contentPane.add(rightPane);        setContentPane(contentPane);    }    private void addLabelTextRows(JLabel[] labels,                                  JTextField[] textFields,                                  GridBagLayout gridbag,                                  Container container) {        GridBagConstraints c = new GridBagConstraints();        c.anchor = GridBagConstraints.EAST;        int numLabels = labels.length;        for (int i = 0; i < numLabels; i++) {            c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last            c.fill = GridBagConstraints.NONE;      //reset to default            c.weightx = 0.0;                       //reset to default            gridbag.setConstraints(labels[i], c);            container.add(labels[i]);            c.gridwidth = GridBagConstraints.REMAINDER;     //end row            c.fill = GridBagConstraints.HORIZONTAL;            c.weightx = 1.0;            gridbag.setConstraints(textFields[i], c);            container.add(textFields[i]);        }    }    public void actionPerformed(ActionEvent e) {        String prefix = "You typed \"";        if (e.getActionCommand().equals(textFieldString)) {            JTextField source = (JTextField)e.getSource();            actionLabel.setText(prefix + source.getText() + "\"");        } else {            JPasswordField source = (JPasswordField)e.getSource();            actionLabel.setText(prefix + new String(source.getPassword())                                + "\"");        }    }    private JEditorPane createEditorPane() {        JEditorPane editorPane = new JEditorPane();        editorPane.setEditable(false);        String s = null;        try {            s = "file:"                + System.getProperty("user.dir")                + System.getProperty("file.separator")                + "TextSamplerDemoHelp.html";            URL helpURL = new URL(s);            displayURL(helpURL, editorPane);        } catch (Exception e) {            System.err.println("Couldn't create help URL: " + s);        }        return editorPane;    }    private void displayURL(URL url, JEditorPane editorPane) {        try {            editorPane.setPage(url);        } catch (IOException e) {            System.err.println("Attempted to read a bad URL: " + url);        }    }    private JTextPane createTextPane() {        JTextPane textPane = new JTextPane();        String[] initString =                { "This is an editable JTextPane, ",		//regular                  "another ",					//italic                  "styled ",					//bold                  "text ",					//small                  "component, ",				//large                  "which supports embedded components..." + newline,//regular                  " " + newline,				//button                  "...and embedded icons..." + newline,		//regular                  " ", 						//icon                  newline + "JTextPane is a subclass of JEditorPane that " +                    "uses a StyledEditorKit and StyledDocument, and provides " +                    "cover methods for interacting with those objects."                 };        String[] initStyles =                 { "regular", "italic", "bold", "small", "large",                  "regular", "button", "regular", "icon",                  "regular"                };        initStylesForTextPane(textPane);        Document doc = textPane.getDocument();        try {            for (int i=0; i < initString.length; i++) {                doc.insertString(doc.getLength(), initString[i],                                 textPane.getStyle(initStyles[i]));            }        } catch (BadLocationException ble) {            System.err.println("Couldn't insert initial text.");        }        return textPane;    }    protected void initStylesForTextPane(JTextPane textPane) {        //Initialize some styles.        Style def = StyleContext.getDefaultStyleContext().                                        getStyle(StyleContext.DEFAULT_STYLE);        Style regular = textPane.addStyle("regular", def);        StyleConstants.setFontFamily(def, "SansSerif");        Style s = textPane.addStyle("italic", regular);        StyleConstants.setItalic(s, true);        s = textPane.addStyle("bold", regular);        StyleConstants.setBold(s, true);        s = textPane.addStyle("small", regular);        StyleConstants.setFontSize(s, 10);        s = textPane.addStyle("large", regular);        StyleConstants.setFontSize(s, 16);        s = textPane.addStyle("icon", regular);        StyleConstants.setAlignment(s, StyleConstants.ALIGN_CENTER);        StyleConstants.setIcon(s, new ImageIcon("images/Pig.gif"));        s = textPane.addStyle("button", regular);        StyleConstants.setAlignment(s, StyleConstants.ALIGN_CENTER);        JButton button = new JButton(new ImageIcon("images/sound.gif"));        button.setMargin(new Insets(0,0,0,0));        button.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                Toolkit.getDefaultToolkit().beep();            }        });        StyleConstants.setComponent(s, button);    }    public static void main(String[] args) {        JFrame frame = new TextSamplerDemo();        frame.addWindowListener(new WindowAdapter() {            public void windowClosing(WindowEvent e) {                System.exit(0);            }        });        frame.pack();        frame.setVisible(true);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精一区二区三区| 91美女片黄在线观看| 这里只有精品视频在线观看| 日韩激情视频在线观看| 欧美成人官网二区| 国产一区二区主播在线| 中文字幕av一区二区三区免费看| 粉嫩aⅴ一区二区三区四区 | 日本不卡不码高清免费观看 | 精品欧美一区二区三区精品久久 | 欧美中文字幕亚洲一区二区va在线| 夜夜精品视频一区二区| 欧美一级片在线看| 国产a视频精品免费观看| 亚洲人快播电影网| 日韩欧美电影在线| 大白屁股一区二区视频| 亚洲国产成人精品视频| 亚洲精品一区二区三区影院| fc2成人免费人成在线观看播放| 一区二区三区日韩欧美精品| 日韩欧美精品在线视频| eeuss鲁片一区二区三区| 亚洲成av人影院在线观看网| 久久久久久久久久久久久女国产乱| 波多野结衣亚洲一区| 视频一区国产视频| 中文一区二区完整视频在线观看| 在线观看一区二区精品视频| 激情综合网激情| 亚洲精品老司机| 亚洲精品一区二区三区蜜桃下载| 91丨九色丨蝌蚪丨老版| 久久99久久精品欧美| 亚洲综合视频网| 欧美国产精品v| 日韩欧美中文字幕精品| 日本韩国欧美三级| 国产99久久久国产精品免费看| 国产伦精品一区二区三区免费| 一区二区欧美在线观看| 日本一区二区成人在线| 日韩亚洲欧美在线| 色悠悠久久综合| 大胆欧美人体老妇| 九九在线精品视频| 视频一区中文字幕| 亚洲最大的成人av| 中文子幕无线码一区tr| 欧美老人xxxx18| 欧美精品国产精品| av中文字幕亚洲| 国产一区在线看| 免费三级欧美电影| 婷婷六月综合亚洲| 亚洲一区二区成人在线观看| 亚洲欧美在线视频| 久久久精品tv| 久久这里只有精品6| 欧美一区二区啪啪| 欧美精品成人一区二区三区四区| 91国产免费观看| 色偷偷久久一区二区三区| 91视视频在线观看入口直接观看www| 国产精品一区在线观看你懂的| 蜜臀av一区二区在线免费观看 | 欧美精品色一区二区三区| 91久久精品午夜一区二区| 99久久综合国产精品| a美女胸又www黄视频久久| www.欧美.com| 色呦呦国产精品| 99精品欧美一区二区蜜桃免费 | 久久久久久久免费视频了| 欧美一区二区在线播放| 欧美日韩你懂的| 欧美精品国产精品| 欧美一卡二卡三卡| 日韩亚洲欧美在线| 精品人在线二区三区| 久久久久久9999| 国产欧美日韩视频一区二区| 国产精品午夜电影| 综合激情网...| 亚洲国产美国国产综合一区二区| 亚洲国产精品久久久男人的天堂| 午夜电影一区二区三区| 免费av网站大全久久| 麻豆视频观看网址久久| 国产麻豆视频精品| av网站免费线看精品| 色猫猫国产区一区二在线视频| 日本久久一区二区| 欧美一区日韩一区| www一区二区| ...中文天堂在线一区| 伊人开心综合网| 日本视频在线一区| 欧美性一级生活| 日韩视频一区二区三区在线播放| 久久夜色精品一区| 中文字幕一区二区在线观看| 亚洲一区二三区| 青娱乐精品在线视频| 成人小视频免费观看| 在线观看精品一区| 精品免费国产一区二区三区四区| 中文字幕成人网| 亚洲成人动漫在线免费观看| 狠狠色2019综合网| 色婷婷久久久久swag精品| 欧美精品三级在线观看| 国产欧美一区二区三区沐欲| 伊人开心综合网| 国产一区二区电影| 色偷偷久久人人79超碰人人澡| 欧美一区二区在线播放| 国产精品久久久久久久久免费桃花 | 国产成人三级在线观看| 欧美综合久久久| 久久蜜桃香蕉精品一区二区三区| 日韩毛片视频在线看| 毛片一区二区三区| 91国偷自产一区二区三区成为亚洲经典| 日韩欧美国产午夜精品| 亚洲黄色免费网站| 高清av一区二区| 日韩美女视频一区二区在线观看| 亚洲欧美aⅴ...| 国产夫妻精品视频| 日韩免费观看高清完整版在线观看| 国产精品久久毛片| 激情深爱一区二区| 欧美美女喷水视频| 亚洲欧美日韩精品久久久久| 国产一区二区看久久| 欧美一区二区福利在线| 亚洲激情校园春色| k8久久久一区二区三区| 久久婷婷国产综合精品青草| 性做久久久久久免费观看| 成人av免费观看| 久久久不卡网国产精品一区| 日本不卡123| 欧美美女网站色| 亚洲一区二区三区影院| 日韩欧美精品在线| 日韩一区欧美二区| 欧美三电影在线| 夜色激情一区二区| 91在线免费播放| 国产精品久久久久9999吃药| 国产精品亚洲成人| 精品999在线播放| 青青草精品视频| 欧美一区二区成人6969| 日韩在线一二三区| 欧美日韩mp4| 天堂久久久久va久久久久| 欧美性色黄大片手机版| 亚洲免费资源在线播放| 99re亚洲国产精品| 亚洲精品免费电影| 欧美亚洲综合久久| 亚洲图片一区二区| 欧美视频一区二区三区在线观看| 一区二区三区在线视频观看| 99riav一区二区三区| 亚洲免费观看高清| 91久久精品一区二区| 亚洲第一电影网| 在线观看91av| 美女免费视频一区二区| 精品99一区二区| 成人一级片在线观看| 国产精品国产三级国产| 一本到三区不卡视频| 亚洲第一综合色| 91精品国产综合久久久蜜臀粉嫩| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩精品一区二区三区老鸭窝 | 久久精品视频在线看| 成人夜色视频网站在线观看| 亚洲欧洲一区二区三区| 欧洲激情一区二区| 日韩av中文字幕一区二区| 久久综合久久综合九色| 成人美女视频在线观看18| 亚洲黄色av一区| 日韩免费观看2025年上映的电影| 国产一区欧美二区| 亚洲视频一区在线观看| 69堂精品视频| 岛国精品一区二区| 亚洲永久精品大片| 久久久美女毛片| 欧亚洲嫩模精品一区三区| 青青草伊人久久| 日韩理论片一区二区| 欧美一区二区精品在线|