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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sketchframe.java

?? Java Classic Examples是我買的兩本書:《JAVA經(jīng)典實(shí)例》和《java入門經(jīng)典源代碼》里邊附送光盤里帶的源碼
?? JAVA
字號(hào):
// Frame for the Sketcher application
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;

public class SketchFrame extends JFrame
                         implements Constants, ActionListener
{
  // Constructor
  public SketchFrame(String title, Sketcher theApp)
  {
    setTitle(title);                              // Set the window title
    this.theApp = theApp;
    setJMenuBar(menuBar);                         // Add the menu bar to the window

    JMenu fileMenu = new JMenu("File");           // Create File menu
    JMenu elementMenu = new JMenu("Elements");    // Create Elements menu
    JMenu optionsMenu = new JMenu("Options");     // Create options menu
    JMenu helpMenu = new JMenu("Help");           // Create Help menu

    fileMenu.setMnemonic('F');                    // Create shortcut
    elementMenu.setMnemonic('E');                 // Create shortcut
    optionsMenu.setMnemonic('O');                 // Create shortcut
    helpMenu.setMnemonic('H');                    // Create shortcut 

    // Construct the file pull down menu
    addMenuItem(fileMenu, 
                newAction = new FileAction("New", "Create new sketch"),
                KeyStroke.getKeyStroke('N',Event.CTRL_MASK ));
    addMenuItem(fileMenu, 
                openAction = new FileAction("Open", "Open existing sketch"), 
                KeyStroke.getKeyStroke('O',Event.CTRL_MASK ));
    addMenuItem(fileMenu, 
                closeAction = new FileAction("Close", "Close sketch"), null);
    fileMenu.addSeparator();                                       // Add separator
    addMenuItem(fileMenu, 
                saveAction = new FileAction("Save", "Save sketch"),
                KeyStroke.getKeyStroke('S',Event.CTRL_MASK ));
    addMenuItem(fileMenu, 
                saveAsAction = new FileAction("Save As...","Save as new file"),
                null);
    fileMenu.addSeparator();                                       // Add separator
    addMenuItem(fileMenu, 
                printAction = new FileAction("Print", "Print sketch"),
                KeyStroke.getKeyStroke('P',Event.CTRL_MASK ));
     
    // Construct the Element pull down menu
    addMenuItem(elementMenu, 
                lineAction = new TypeAction("Line", LINE, "Draw lines"));
    addMenuItem(elementMenu, 
                rectangleAction = new TypeAction("Rectangle", RECTANGLE, 
                                                 "Draw rectangles"));
    addMenuItem(elementMenu, 
                circleAction = new TypeAction("Circle", CIRCLE, "Draw circles"));
    addMenuItem(elementMenu, 
                curveAction = new TypeAction("Curve", CURVE, "Draw curves"));
    addMenuItem(elementMenu, textAction = new TypeAction("Text", TEXT,
                                                         "Draw text"), null);

    elementMenu.addSeparator();

    JMenu colorMenu = new JMenu("Color");         // Color sub-menu
    elementMenu.add(colorMenu);                   // Add the sub-menu
    addMenuItem(colorMenu, 
                redAction = new ColorAction("Red", Color.red, "Draw in red"));
    addMenuItem(colorMenu, 
                yellowAction = new ColorAction("Yellow", Color.yellow,
                                                               "Draw in yellow"));
    addMenuItem(colorMenu, 
                greenAction = new ColorAction("Green", Color.green, 
                                                                "Draw in green"));
    addMenuItem(colorMenu, 
                blueAction = new ColorAction("Blue", Color.blue, "Draw in blue"));

    // Add the font choice item to the options menu
    fontItem = new JMenuItem("Choose font...");
    fontItem.addActionListener(this);
    optionsMenu.add(fontItem);

    // Add the About item to the Help menu
    aboutItem = new JMenuItem("About");           // Create the item
    aboutItem.addActionListener(this);            // Listener is the frame
    helpMenu.add(aboutItem);                      // Add item to menu

    menuBar.add(fileMenu);                        // Add the file menu
    menuBar.add(elementMenu);                     // Add the element menu
    menuBar.add(optionsMenu);                     // Add the options menu
    menuBar.add(helpMenu);                        // Add the Help menu

    // Add file buttons
    toolBar.addSeparator();                                 // Space at the start
    addToolBarButton(newAction);
    addToolBarButton(openAction);
    addToolBarButton(saveAction);
    addToolBarButton(printAction);
   
    // Add element type buttons
    toolBar.addSeparator();
    addToolBarButton(lineAction);
    addToolBarButton(rectangleAction);
    addToolBarButton(circleAction);
    addToolBarButton(curveAction);
    addToolBarButton(textAction);

    // Add element color buttons
    toolBar.addSeparator();
    addToolBarButton(redAction);
    addToolBarButton(yellowAction);
    addToolBarButton(greenAction);
    addToolBarButton(blueAction);
    toolBar.addSeparator();                            // Space at the end

    // Create pop-up menu
    popup.add(lineAction);
    popup.add(rectangleAction);
    popup.add(circleAction);
    popup.add(curveAction);
    popup.add(textAction);

    popup.addSeparator();
    popup.add(redAction);
    popup.add(yellowAction);
    popup.add(greenAction);
    popup.add(blueAction);

    toolBar.setBorder(BorderFactory.createCompoundBorder(       // Toolbar border
                      BorderFactory.createLineBorder(Color.darkGray),
                      BorderFactory.createEmptyBorder(2,2,4,2)));   

    toolBar.setFloatable(false);                       // Inhibit toolbar floating
    getContentPane().add(toolBar, BorderLayout.NORTH); // Add the toolbar

    // Disable actions
    saveAction.setEnabled(false);
    closeAction.setEnabled(false);
    printAction.setEnabled(false);
    getContentPane().add(statusBar, BorderLayout.SOUTH);         // Add the statusbar
    fontDlg = new FontDialog(this);

    customColorItem = popup.add("Custom Color...");    // Add the item
    customColorItem.addActionListener(this);           // and add its listener
  }

  private JButton addToolBarButton(Action action)
  {
    JButton button = toolBar.add(action);                     // Add toolbar button
    button.setToolTipText((String)action.getValue(action.SHORT_DESCRIPTION));
    button.setBorder(BorderFactory.createRaisedBevelBorder()); // Add button border
    button.setText(null);                                     // No button text
    return button;
  }

  private JMenuItem addMenuItem(JMenu menu, Action action)
  {
    JMenuItem item = menu.add(action);                  // Add the menu item
    item.setIcon(null);                                 // Remove the icon
    return item;                                        // Return the menu item
  }

  private JMenuItem addMenuItem(JMenu menu, Action action, KeyStroke keystroke)
  {
    JMenuItem item = addMenuItem(menu, action);         // Add the menu item
    item.setAccelerator(keystroke);                     // Set the accelerator
    return item;                                        // Return the menu item
  }

  // File actions
  private FileAction newAction, openAction, closeAction,
                     saveAction, saveAsAction, printAction;
  // Element type actions
  private TypeAction lineAction, rectangleAction, circleAction,
                     curveAction, textAction;
  // Element color actions
  private ColorAction redAction, yellowAction,
                      greenAction, blueAction;

  private JMenuBar menuBar = new JMenuBar();               // Window menu bar

  private Color elementColor = DEFAULT_ELEMENT_COLOR;      // Current element color
  private int elementType = DEFAULT_ELEMENT_TYPE;          // Current element type
  private Font font = DEFAULT_FONT;                        // Current font

  private JToolBar toolBar = new JToolBar();                  // Window toolbar
  StatusBar statusBar = new StatusBar();                      // Window status bar
  private JPopupMenu popup = new JPopupMenu("General");       // Window pop-up

  // Sundry menu items
  private JMenuItem aboutItem, fontItem;
  private FontDialog fontDlg;                     // The font dialog

  private JMenuItem customColorItem;

  Sketcher theApp;

  // We will add inner classes defining action objects here...
  class FileAction extends AbstractAction
  {    
    FileAction(String name)
    {
      super(name);
      String iconFileName = "Images/" + name + ".gif";
      if(new File(iconFileName).exists())
        putValue(SMALL_ICON, new ImageIcon(iconFileName));
    }

    FileAction(String name, String tooltip)
    {
      this(name);                                     // Call the other constructor
      if(tooltip != null)                             // If there is tooltip text
        putValue(SHORT_DESCRIPTION, tooltip);         // ...squirrel it away
    }

    public void actionPerformed(ActionEvent e)
    {
      // We will add action code here eventually...
    }
  }

  class TypeAction extends AbstractAction
  {    
    TypeAction(String name, int typeID)
    {
      super(name);
      this.typeID = typeID;
      String iconFileName = "Images/" + name + ".gif";
      if(new File(iconFileName).exists())
        putValue(SMALL_ICON, new ImageIcon(iconFileName));
    }

    TypeAction(String name, int typeID, String tooltip)
    {
      this(name, typeID);
      if(tooltip != null)                               // If there is a tooltip
        putValue(SHORT_DESCRIPTION, tooltip);           // ...squirrel it away
    }
    
    public void actionPerformed(ActionEvent e)
    {
      elementType = typeID;
      statusBar.setTypePane(typeID);
    }

    private int typeID;
  }

  // Handles color menu items
  class ColorAction  extends AbstractAction
  {
    public ColorAction(String name, Color color)
    {
      super(name);
      this.color = color;
      String iconFileName = "Images/" + name + ".gif";
      if(new File(iconFileName).exists())
        putValue(SMALL_ICON, new ImageIcon(iconFileName));
    }

    public ColorAction(String name, Color color, String tooltip)
    {
      this(name, color);
      if(tooltip != null)                               // If there is a tooltip
        putValue(SHORT_DESCRIPTION, tooltip);           // ...squirrel it away
    }

    public void actionPerformed(ActionEvent e)
    {
      elementColor = color;
      statusBar.setColorPane(color);
    }

    private Color color;
  }

  public Color getElementColor()
  { 
    return elementColor; 
  }

  public int getElementType()
  { 
    return elementType; 
  }

  public Font getCurrentFont()
  {
    return font;
  }

  // Retrieve the pop-up menu
  public JPopupMenu getPopup()
  {
    return popup;
  }

  public void actionPerformed(ActionEvent e)
  {
    if(e.getSource() == aboutItem)
    {
      // Create about dialog with the menu item as parent
      JOptionPane.showMessageDialog((Component)e.getSource(),       // Parent
                             "Sketcher Copyright Ivor Horton 1999", // Message
                             "About Sketcher",                      // Title
                                 JOptionPane.INFORMATION_MESSAGE);  // Message type
    }
    else if(e.getSource() == fontItem)
    { // Set the dialog window position
      Rectangle bounds = getBounds();
      fontDlg.setLocation(bounds.x + bounds.width/3, bounds.y + bounds.height/3);

      fontDlg.setVisible(true);            // Show the dialog
    }
    else if(e.getSource() == customColorItem)
    {
      Color color = JColorChooser.showDialog(this, "Select Custom Color",
                                                           elementColor);
      if(color != null)
      {
        elementColor = color;
        statusBar.setColorPane(color);
      }
    }
  }

  public void setCurrentFont(Font font)
  {
    this.font = font;
  }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色天天综合色天天久久| 91久久人澡人人添人人爽欧美| 亚洲女同女同女同女同女同69| 欧美精品成人一区二区三区四区| 成人免费看视频| 日本视频在线一区| 一区二区三区精品视频在线| 国产亚洲精品精华液| 91精品国产综合久久精品性色| 91麻豆精品一区二区三区| 国产资源在线一区| 午夜精品视频一区| 亚洲精品视频在线观看网站| 久久久久久毛片| 日韩精品在线一区二区| 欧美日韩黄色一区二区| 91亚洲国产成人精品一区二三 | 欧美日韩国产精品成人| 成人一区在线观看| 国产主播一区二区三区| 日韩国产一区二| 一区二区三区日韩在线观看| 亚洲欧美综合色| 国产日韩成人精品| 久久久久99精品国产片| 欧美va在线播放| 6080亚洲精品一区二区| 欧美日韩久久一区| 在线精品视频一区二区| 色偷偷久久人人79超碰人人澡| 国产91色综合久久免费分享| 国产乱对白刺激视频不卡| 久久66热偷产精品| 麻豆freexxxx性91精品| 美日韩一区二区| 久久国产精品区| 久久精品国产99| 欧美日韩精品一区二区三区蜜桃 | 欧美美女一区二区在线观看| 欧美性生交片4| 欧美性生活影院| 欧美日本在线看| 91精品国产色综合久久久蜜香臀| 欧美日韩你懂得| 在线不卡一区二区| 日韩免费看的电影| 精品美女在线观看| 久久精品综合网| 国产视频一区二区在线| 国产精品午夜电影| 亚洲日本免费电影| 一区av在线播放| 亚洲午夜久久久久久久久久久| 亚洲第一二三四区| 天使萌一区二区三区免费观看| 日韩vs国产vs欧美| 国精产品一区一区三区mba桃花| 国产精品一级片在线观看| 成人高清av在线| 色综合天天综合狠狠| 亚洲你懂的在线视频| 亚洲一区在线免费观看| 日韩电影在线观看电影| 六月丁香综合在线视频| 国产精品77777| 91免费国产在线观看| 欧美日韩国产一区| 精品处破学生在线二十三| 国产精品久久三| 午夜精品久久久久久久| 国产呦萝稀缺另类资源| 91片黄在线观看| 欧美高清视频www夜色资源网| 欧美成人r级一区二区三区| 中文字幕av不卡| 亚洲一区二区三区中文字幕在线| 日本三级亚洲精品| 大尺度一区二区| 欧美精品三级在线观看| 久久久精品欧美丰满| 国产精品另类一区| 日本不卡一区二区三区高清视频| 国产在线播放一区| 欧美色精品天天在线观看视频| 日韩精品一区二区三区老鸭窝| 国产精品欧美一区喷水| 日韩不卡一二三区| 91片黄在线观看| 日韩一级高清毛片| 综合色中文字幕| 精品一区二区久久久| 91麻豆.com| 亚洲精品一区二区三区在线观看| 亚洲女女做受ⅹxx高潮| 精品一区二区三区蜜桃| 欧美性大战久久| 国产精品视频免费| 六月婷婷色综合| 欧洲精品一区二区三区在线观看| 2017欧美狠狠色| 五月天久久比比资源色| 成人福利视频在线看| 精品国产电影一区二区| 五月天中文字幕一区二区| k8久久久一区二区三区 | 亚洲欧洲综合另类在线| 国产精品自产自拍| 欧美电视剧在线看免费| 亚洲国产精品一区二区久久恐怖片| 成人三级在线视频| 精品免费国产二区三区| 日韩电影一二三区| 欧美日韩在线免费视频| 亚洲欧美日韩国产综合| 成人avav在线| 久久久影视传媒| 精品亚洲国产成人av制服丝袜| 欧美日韩不卡视频| 亚洲精品一二三| 99精品在线免费| 国产精品国产三级国产aⅴ无密码| 国产精品一卡二| 2019国产精品| 精品一区二区三区视频| 国产精品乱码一区二区三区软件| 美腿丝袜亚洲色图| 日韩三级免费观看| 免费在线视频一区| 欧美日韩大陆一区二区| 婷婷成人激情在线网| 欧美日韩精品综合在线| 亚洲国产中文字幕在线视频综合 | 国产真实乱对白精彩久久| 日韩女优制服丝袜电影| 久久爱www久久做| 欧美不卡一区二区三区| 久久国产精品无码网站| 精品久久久久久久久久久久久久久 | 国产精品盗摄一区二区三区| 国产盗摄一区二区三区| 欧美国产在线观看| 成人午夜电影网站| 成人免费在线播放视频| 91麻豆自制传媒国产之光| 亚洲美女视频在线| 欧美三级韩国三级日本三斤 | 亚洲精品中文在线| 91福利视频网站| 午夜精品一区二区三区免费视频| 欧美日韩激情一区二区三区| 天天影视涩香欲综合网| 日韩欧美国产系列| 国产一区二区三区在线看麻豆| 国产欧美一区二区精品秋霞影院| 成人av网站免费| 一区二区欧美视频| 91精品国产91久久久久久最新毛片| 日本欧美加勒比视频| 亚洲精品在线观看网站| 不卡的av电影在线观看| 亚洲美女电影在线| 制服丝袜在线91| 国产精品一二三四区| 亚洲三级视频在线观看| 欧美视频自拍偷拍| 韩国av一区二区三区| 亚洲素人一区二区| 制服视频三区第一页精品| 国产麻豆精品久久一二三| 亚洲欧美日韩系列| 91精品国产色综合久久| 高清免费成人av| 亚洲国产日韩一级| 久久老女人爱爱| 欧美性色综合网| 国产精品影音先锋| 亚洲在线观看免费| 国产视频一区在线观看| 精品视频一区二区不卡| 国产美女娇喘av呻吟久久 | 国产精品自拍三区| 亚洲精品成人悠悠色影视| 欧美一区二区国产| 91美女视频网站| 久草热8精品视频在线观看| 亚洲欧美日韩在线播放| 亚洲精品在线免费播放| 色综合久久久久网| 国模无码大尺度一区二区三区| 一区二区三区美女视频| 久久久久久亚洲综合| 欧美日韩激情一区二区| 粗大黑人巨茎大战欧美成人| 免费看日韩精品| 亚洲黄色av一区| 中文字幕乱码一区二区免费| 日韩一区二区三| 色爱区综合激月婷婷| 成人性生交大合| 国产一区美女在线|