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

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

?? sketchframe.java

?? Java Classic Examples是我買的兩本書:《JAVA經典實例》和《java入門經典源代碼》里邊附送光盤里帶的源碼
?? JAVA
字號:
// 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 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

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

    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

    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
    getContentPane().add(statusBar, BorderLayout.SOUTH);         // Add the statusbar

    // Disable actions
    saveAction.setEnabled(false);
    closeAction.setEnabled(false);
    printAction.setEnabled(false);

    fontDlg = new FontDialog(this);

    // 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);

  }

  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
  }

  // 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;
  }

  // Handle About menu action events
  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
    }
  }

  public Color getElementColor()
  { return elementColor; }

  public int getElementType()
  { return elementType; }

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

  public Font getCurrentFont()
  {  return font;  }

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


  // 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
  private JMenuItem aboutItem, fontItem;
  private FontDialog fontDlg;                              // The font dialog
  private JPopupMenu popup = new JPopupMenu("General");    // Window pop-up
  StatusBar statusBar = new StatusBar();                   // Window status bar
  private Sketcher theApp;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产色一区二区| 91麻豆福利精品推荐| 亚洲一区二区三区四区在线观看| 久久久精品国产免大香伊| 欧美精三区欧美精三区 | 欧美影片第一页| 色综合激情五月| 在线观看亚洲成人| 欧美丝袜丝nylons| 91精品中文字幕一区二区三区| 欧美揉bbbbb揉bbbbb| 91精品国产一区二区三区蜜臀| 日韩视频永久免费| 久久久蜜臀国产一区二区| 日本一区二区成人| 亚洲欧美另类综合偷拍| 亚洲国产欧美在线| 精品一区二区三区免费毛片爱| 国产精品一区二区黑丝| 成人av资源站| 欧美日韩在线三级| 成人黄色国产精品网站大全在线免费观看| 成人听书哪个软件好| 色综合久久88色综合天天6| 国产精品1区二区.| 91免费国产在线观看| 日韩午夜中文字幕| 欧美三级视频在线观看| 欧美一区二区三区免费观看视频| 成人福利视频在线| 日本乱人伦aⅴ精品| 91精品国产91久久综合桃花| 亚洲精品第一国产综合野| 毛片av一区二区| 在线免费观看成人短视频| 亚洲综合清纯丝袜自拍| 亚洲理论在线观看| 日韩欧美国产综合在线一区二区三区 | 97精品国产露脸对白| 色婷婷av一区二区三区软件 | 精品国产三级电影在线观看| 久久久.com| 亚洲国产欧美另类丝袜| 国产一区二区在线观看视频| 91女厕偷拍女厕偷拍高清| 欧美变态tickle挠乳网站| 亚洲人成电影网站色mp4| 久久99精品一区二区三区| 91搞黄在线观看| 精品久久人人做人人爱| 一区二区三区免费看视频| 国产精品一区二区在线观看不卡 | voyeur盗摄精品| 日韩一区二区在线观看视频播放| 国产精品传媒入口麻豆| 精品制服美女丁香| 欧美乱熟臀69xxxxxx| 亚洲人精品午夜| 国产ts人妖一区二区| 日韩欧美国产一区二区在线播放| 亚洲精品日韩一| 不卡高清视频专区| 国产午夜精品一区二区| 蜜臀久久99精品久久久久宅男 | 91精品中文字幕一区二区三区 | 91久久香蕉国产日韩欧美9色| 久久一区二区三区四区| 丝袜美腿亚洲色图| 欧美吻胸吃奶大尺度电影| 亚洲欧美一区二区久久| 白白色 亚洲乱淫| 国产精品丝袜久久久久久app| 精品一二三四区| 精品国产免费一区二区三区香蕉| 日韩电影在线一区二区| 欧美视频精品在线| 亚洲制服丝袜一区| 欧美日韩免费视频| 婷婷成人激情在线网| 欧美日韩成人一区二区| 亚洲成av人影院| 欧美日韩国产三级| 日韩不卡免费视频| 91精品国产综合久久久蜜臀图片 | 日韩免费视频一区| 久久99久久久久| 久久综合色综合88| 国产91精品露脸国语对白| 国产精品久久久久桃色tv| 91色婷婷久久久久合中文| 一区二区三区电影在线播| 欧美日韩一区二区在线视频| 日本视频一区二区| 久久综合99re88久久爱| 波多野结衣中文字幕一区二区三区 | www激情久久| 成人性视频免费网站| 1024成人网| 欧美日韩一二区| 韩国av一区二区三区四区| 欧美高清在线精品一区| 日本韩国一区二区| 美女在线视频一区| 欧美国产禁国产网站cc| 色美美综合视频| 六月婷婷色综合| 久久九九久久九九| 91社区在线播放| 免费观看日韩av| 亚洲丝袜制服诱惑| 日韩天堂在线观看| 岛国精品在线播放| 日韩精品电影在线| 国产精品久线观看视频| 欧美酷刑日本凌虐凌虐| 国产精品一线二线三线精华| 亚洲综合成人在线| 国产婷婷精品av在线| 欧美女孩性生活视频| 成人午夜看片网址| 蜜臀91精品一区二区三区| 亚洲日本成人在线观看| 久久综合网色—综合色88| 欧美日韩精品一区二区天天拍小说| 国产精品原创巨作av| 青草国产精品久久久久久| 亚洲另类春色国产| 国产精品麻豆一区二区| 欧美mv日韩mv| 国产日韩欧美精品一区| 5566中文字幕一区二区电影| 99r国产精品| 国产v日产∨综合v精品视频| 另类调教123区| 午夜影院久久久| 亚洲美女视频在线观看| 欧美国产成人精品| 国产午夜精品久久久久久久| 日韩精品中文字幕在线不卡尤物| 欧美体内she精高潮| 91性感美女视频| av中文字幕在线不卡| 国产老肥熟一区二区三区| 欧美a一区二区| 日韩影视精彩在线| 午夜精品成人在线视频| 亚洲一区二区三区国产| 亚洲精品欧美综合四区| 亚洲乱码国产乱码精品精可以看| 久久精品综合网| 国产三级一区二区| 久久久精品国产免费观看同学| xnxx国产精品| 国产亚洲午夜高清国产拍精品| 久久网站热最新地址| 久久先锋资源网| 国产三区在线成人av| 国产嫩草影院久久久久| 欧美激情在线观看视频免费| 中文字幕免费在线观看视频一区| 久久精品欧美一区二区三区麻豆 | 国产成人啪免费观看软件| 国产一二三精品| 风流少妇一区二区| 不卡av在线免费观看| 99re热这里只有精品免费视频| 97成人超碰视| 欧美欧美午夜aⅴ在线观看| 日韩手机在线导航| 久久精品夜色噜噜亚洲aⅴ| 日本一区二区视频在线观看| 1000部国产精品成人观看| 夜色激情一区二区| 奇米影视在线99精品| 国产一区二区三区久久悠悠色av| 懂色av一区二区夜夜嗨| 91麻豆国产福利在线观看| 欧美美女视频在线观看| 欧美xxx久久| 自拍偷自拍亚洲精品播放| 亚洲国产成人精品视频| 精品一区精品二区高清| 成人a区在线观看| 欧美日韩一区二区三区在线看| 日韩一级视频免费观看在线| 欧美激情资源网| 亚洲成人福利片| 国产在线精品一区二区不卡了 | 国产一二三精品| 欧洲色大大久久| wwwwxxxxx欧美| 亚洲欧美一区二区三区极速播放 | 色综合天天综合色综合av| 91精品国产综合久久久久久久久久 | 精品久久久久久久久久久院品网 | 国产成人免费视频一区| 在线观看视频一区二区欧美日韩| 欧美成人三级在线| 一区二区成人在线观看| 国产一区二区视频在线播放|