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

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

?? fontdialog.java

?? 非常好的java事例以及帶源碼事例的java2教程
?? JAVA
字號:
// Class to define a dialog to choose a font
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.awt.event.*;

class FontDialog extends JDialog
                 implements Constants,
                            ActionListener,         // For buttons etc
                            ListSelectionListener   // For list box
{
  // Constructor
  public FontDialog(SketchFrame window)
  {
    // Call the base constructor to create a modal dialog
    super(window, "Font Selection", true);   

    this.window = window;                          // Save the window reference
    font = window.getCurrentFont();                // Get the current font
    fontStyle = font.getStyle();                   // ...style
    fontSize = font.getSize();                     // ...and size

    // Create the dialog button panel 
    JPanel buttonPane = new JPanel();             // Create the panel to hold buttons

    // Create and add the buttons to the buttonPane
    buttonPane.add(ok = createButton("OK"));              // Add the OK button
    buttonPane.add(cancel = createButton("Cancel"));      // Add the Cancel button
    getContentPane().add(buttonPane, BorderLayout.SOUTH); // Add pane to content pane

    // Code to create the data input panel
    JPanel dataPane = new JPanel();                    // Create the data entry panel
    dataPane.setBorder(BorderFactory.createCompoundBorder(   // Create pane border
                       BorderFactory.createLineBorder(Color.black),
                       BorderFactory.createEmptyBorder(5, 5, 5, 5)));  
    GridBagLayout gbLayout = new GridBagLayout();            // Create the layout
    dataPane.setLayout(gbLayout);                            // Set the pane layout
    GridBagConstraints constraints = new GridBagConstraints();

    // Code to create the font choice and add it to the input panel
    JLabel label = new JLabel("Choose a Font");
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.gridwidth = GridBagConstraints.REMAINDER; 
    gbLayout.setConstraints(label, constraints);
    dataPane.add(label);

    // Code to set up font list choice component
    GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] fontNames = e.getAvailableFontFamilyNames();  // Get the font names

    fontList = new JList(fontNames);                     // Create list of font names
    fontList.setValueIsAdjusting(true);                  // single event selection
    fontList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // Choose 1 font
    fontList.setSelectedValue(font.getFamily(),true);
    fontList.addListSelectionListener(this);
    JScrollPane chooseFont = new JScrollPane(fontList);  // Scrollable list
    chooseFont.setMinimumSize(new Dimension(300,100));

    // Panel to display font sample
    JPanel display = new JPanel();
    fontDisplay = new JLabel("Sample Size: x X y Y z Z");
    fontDisplay.setPreferredSize(new Dimension(300,100));
    display.add(fontDisplay);

    //Create a split pane with font choice at the top
    // and font display at the bottom
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                                          true,
                                          chooseFont,
                                          display);
    gbLayout.setConstraints(splitPane, constraints);   // Split pane constraints
    dataPane.add(splitPane);                           // Add to the data pane

    // Set up the size choice using a combobox
    JPanel sizePane = new JPanel();                 // Pane for size choices
    label = new JLabel("Choose point size");        // Prompt for point size
    sizePane.add(label);                            // Add the prompt
    String[] sizeList = { "8", "10", "12", "14", "16",        // Array of sizes
                          "18", "20", "22", "24"};
    chooseSize = new JComboBox(sizeList);                     // Size choice combobox
    chooseSize.setSelectedItem(Integer.toString(fontSize));   // Default selection
    chooseSize.addActionListener(this);                       // Add size listener
    sizePane.add(chooseSize);                                 // Add combobox to pane
    gbLayout.setConstraints(sizePane, constraints);           // Set pane constraints
    dataPane.add(sizePane);                                   // Add the pane
  
    // Set up style options using radio buttons
    JRadioButton bold = new JRadioButton("Bold", (fontStyle & Font.BOLD) > 0);
    JRadioButton italic = new JRadioButton("Italic", (fontStyle & Font.ITALIC) > 0);
    bold.addItemListener(new StyleListener(Font.BOLD));       // Add button listeners
    italic.addItemListener(new StyleListener(Font.ITALIC));
    JPanel stylePane = new JPanel();                          // Create style pane
    stylePane.add(bold);                                      // Add buttons
    stylePane.add(italic);                                    // to style pane...
    gbLayout.setConstraints(stylePane, constraints);          // Set pane constraints
    dataPane.add(stylePane);                                  // Add the pane

    getContentPane().add(dataPane, BorderLayout.CENTER);
    pack();
    setVisible(false);
  }

  JButton createButton(String label)
  {
    JButton button = new JButton(label);                  // Create the button
    button.setPreferredSize(new Dimension(80,20));        // Set the size
    button.addActionListener(this);                       // Listener is the dialog
    return button;                                        // Return the button
  }

  public void actionPerformed(ActionEvent e)
  {
    Object source = e.getSource();                // Get the source of the event
    if(source == ok)                              // Is it the OK button?
    {
      window.setCurrentFont(font);                // Set the selected font
      setVisible(false);                          // Hide the dialog
    }
    else if(source == cancel)                     // If it is the Cancel button
      setVisible(false);                          // just hide the dialog
    else if(source == chooseSize)
    {
      fontSize = Integer.parseInt((String)chooseSize.getSelectedItem());
      font = font.deriveFont((float)fontSize);
      fontDisplay.setFont(font);
      fontDisplay.repaint();
    }
  }

  // List selection listener method
  public void valueChanged(ListSelectionEvent e)
  {
    if(!e.getValueIsAdjusting())
    {
      font = new Font((String)fontList.getSelectedValue(), fontStyle, fontSize);
      fontDisplay.setFont(font);
      fontDisplay.repaint();
    }
  }

  class StyleListener implements ItemListener
  {
    public StyleListener(int style)
    {  
      this.style = style;  
    }

    public void itemStateChanged(ItemEvent e)
    {
      if(e.getStateChange()==ItemEvent.SELECTED)   // If style was selected
        fontStyle |= style;                        // turn it on in the font style
      else
        fontStyle &= ~style;                       // otherwise turn it off

      font = font.deriveFont(fontStyle);           // Get a new font
      fontDisplay.setFont(font);                   // Change the label font
      fontDisplay.repaint();                       // repaint
    }    
 
    private int style;                             // Style for this listener
  }

  private SketchFrame window;        // The application window
  private Font font;                 // Currently selected font
  private int fontStyle;             // Font style - Plain,Bold,Italic
  private int fontSize;              // Font point size
  private JButton ok;                // OK button
  private JButton cancel;            // Cancel button
  private JList fontList;            // Font list
  private JComboBox chooseSize;                     // Font size options
  private JLabel fontDisplay;                       // Font sample
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人在线综合网| 欧美精品一区二区三区四区| 欧美日韩性生活| 久久久久九九视频| 亚洲成av人综合在线观看| 成人一区二区在线观看| 91精品国产综合久久精品麻豆| 欧美国产精品v| 精东粉嫩av免费一区二区三区| 欧美亚洲综合色| 18欧美亚洲精品| 国产精品18久久久久久久网站| 欧美美女喷水视频| 亚洲人精品午夜| 国产激情视频一区二区三区欧美| 欧美老肥妇做.爰bbww视频| 国产精品嫩草影院com| 精品夜夜嗨av一区二区三区| 欧美日本韩国一区| 亚洲午夜一区二区| 色综合久久天天| 中文字幕中文字幕一区| 国产精品主播直播| 精品国产伦理网| 久久国产精品无码网站| 91精品国产一区二区人妖| 亚洲国产毛片aaaaa无费看| 色综合婷婷久久| 国产精品免费网站在线观看| 国产成人aaa| 国产婷婷一区二区| 成人污视频在线观看| 久久久激情视频| 国产精品一区二区三区99| 久久午夜免费电影| 国产精品123| 国产精品福利在线播放| www.久久久久久久久| 中文字幕中文字幕中文字幕亚洲无线 | 成人午夜伦理影院| 亚洲国产精品传媒在线观看| 粉嫩av一区二区三区| 日本一区二区三区久久久久久久久不| 国产综合色产在线精品| 久久综合狠狠综合久久激情| 国产精品自在在线| 一区二区中文视频| 色一情一乱一乱一91av| 亚洲午夜久久久| 欧美一区二区三区色| 激情综合网天天干| 国产精品麻豆99久久久久久| 99久久国产综合精品女不卡| 亚洲一区二区三区在线播放| 国产欧美一区视频| 99精品黄色片免费大全| 亚洲一区二区在线观看视频| 3d动漫精品啪啪1区2区免费| 国内精品国产三级国产a久久| 欧美激情一区不卡| 在线观看国产91| 男男视频亚洲欧美| 国产欧美日韩在线看| 色噜噜狠狠一区二区三区果冻| 亚洲最新视频在线观看| 日韩欧美中文字幕一区| 成人黄动漫网站免费app| 一区二区欧美精品| 精品电影一区二区| 色8久久人人97超碰香蕉987| 精品一区二区三区视频| 亚洲精品伦理在线| 久久蜜桃av一区二区天堂 | 久久精品国产免费看久久精品| 国产色综合一区| 欧美日韩国产美女| 成人国产精品免费观看动漫| 三级影片在线观看欧美日韩一区二区 | 欧美日韩精品免费观看视频| 国产成人自拍高清视频在线免费播放| 夜色激情一区二区| 欧美韩日一区二区三区四区| 欧美丰满一区二区免费视频| 久久成人久久爱| 在线播放视频一区| 91丨porny丨国产| 日韩理论片一区二区| 欧美一级免费大片| 成人精品免费看| 看片网站欧美日韩| 亚洲日本在线a| 欧美sm美女调教| 欧洲激情一区二区| 国产一区二区三区电影在线观看| 亚洲激情图片小说视频| 精品国产伦一区二区三区免费| 色婷婷久久久久swag精品 | 不卡视频免费播放| 首页国产丝袜综合| 激情综合网最新| 亚洲啪啪综合av一区二区三区| 欧美一级片免费看| 色婷婷久久久久swag精品| 精品综合免费视频观看| 亚洲一级二级在线| 国产精品天美传媒| 精品成人一区二区| 欧美精品丝袜中出| 欧美精品久久久久久久久老牛影院| 国产成人午夜电影网| 免费高清不卡av| 亚洲国产综合视频在线观看| 中文字幕精品在线不卡| 久久久综合网站| 国产色91在线| 亚洲精品一区二区三区影院 | 欧美久久一二区| 91激情在线视频| 成人的网站免费观看| www.亚洲在线| 成人三级在线视频| 国产精品一区二区三区四区| 日韩—二三区免费观看av| 一区二区三区四区在线播放| 久久免费美女视频| 欧美国产欧美亚州国产日韩mv天天看完整| 欧美一级生活片| 日韩写真欧美这视频| 欧美二区三区的天堂| 欧美综合亚洲图片综合区| 99国产欧美另类久久久精品| 欧美三区免费完整视频在线观看| 91浏览器打开| 色婷婷久久综合| 欧美日韩免费高清一区色橹橹| 色94色欧美sute亚洲13| 91看片淫黄大片一级在线观看| 欧美日韩一区中文字幕| 欧美日韩一级黄| 91精品欧美福利在线观看| 日韩欧美一二三四区| 久久亚洲精品小早川怜子| 亚洲色图在线视频| 亚洲美女在线一区| 亚洲国产精品久久人人爱蜜臀| 日韩精品欧美成人高清一区二区| 婷婷国产在线综合| 麻豆国产欧美日韩综合精品二区| 国产成人一区在线| 97se亚洲国产综合自在线| 91高清视频在线| 91精品欧美久久久久久动漫 | 欧美高清dvd| 国产偷国产偷精品高清尤物| 国产精品色眯眯| 亚洲与欧洲av电影| 日本色综合中文字幕| 国产69精品久久777的优势| 国产69精品久久久久毛片 | 成人一区二区三区视频在线观看| 99国产精品视频免费观看| 欧美亚洲国产bt| 欧美一区二区三区精品| 亚洲欧美中日韩| 日韩精品亚洲专区| 国产成人精品网址| 欧美视频在线播放| 久久免费的精品国产v∧| 日韩黄色小视频| 国产69精品久久777的优势| 91在线观看美女| 欧美精三区欧美精三区| 精品成人私密视频| 国产精品福利在线播放| 久久99精品视频| 欧美精品乱人伦久久久久久| 久久一区二区三区四区| 91免费看视频| 精品国产成人系列| 亚洲精品成人少妇| 国产一区二区三区黄视频 | 91蜜桃在线观看| 日韩精品一区在线| 亚洲麻豆国产自偷在线| 国产一区二区三区香蕉| 欧美三级日韩在线| 亚洲男人天堂av| 国产精品18久久久久久久久| 91精品国产全国免费观看| 亚洲三级理论片| 成人免费高清视频在线观看| 久久精品亚洲精品国产欧美kt∨| 亚洲国产综合在线| 91丨九色porny丨蝌蚪| 久久精品一区蜜桃臀影院| 国产精品欧美极品| 成人午夜电影网站| 久久久久久麻豆| 久久成人麻豆午夜电影| 日韩一级欧美一级|