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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? sketchframe.java

?? Java Classic Examples是我買(mǎi)的兩本書(shū):《JAVA經(jīng)典實(shí)例》和《java入門(mén)經(jīng)典源代碼》里邊附送光盤(pán)里帶的源碼
?? 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 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;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费福利电影在线观看| 国产精品乱人伦中文| 久久久亚洲国产美女国产盗摄| 中文字幕欧美国产| 日本中文字幕一区二区有限公司| 粉嫩高潮美女一区二区三区 | 精品国一区二区三区| 国产精品久久久久久久久搜平片| 天堂久久一区二区三区| 91啪在线观看| 国产亚洲欧美在线| 蜜桃av一区二区在线观看| 91久久香蕉国产日韩欧美9色| 国产午夜三级一区二区三| 看片的网站亚洲| 欧美夫妻性生活| 亚洲18色成人| 欧美三级视频在线| 亚洲一区在线播放| 日本高清免费不卡视频| 国产午夜精品一区二区| 狠狠色丁香婷婷综合久久片| 欧美日韩一区二区电影| 亚洲成人一二三| 欧美综合欧美视频| 亚洲午夜日本在线观看| 欧美亚洲禁片免费| 亚洲国产欧美日韩另类综合 | 久久久www免费人成精品| 奇米在线7777在线精品| 欧美日韩亚洲国产综合| 亚洲人精品一区| 97国产精品videossex| 亚洲欧美另类小说视频| 一本到高清视频免费精品| 自拍偷在线精品自拍偷无码专区| 播五月开心婷婷综合| 中文字幕永久在线不卡| 99精品热视频| 亚洲国产一区二区三区| 欧美电影一区二区三区| 免费观看日韩电影| 欧美精品一区男女天堂| 福利电影一区二区| 亚洲同性同志一二三专区| 不卡的电影网站| 一级特黄大欧美久久久| 欧美精品自拍偷拍| 国精品**一区二区三区在线蜜桃| 久久精品一区二区三区不卡| 国产福利91精品| 亚洲天堂精品在线观看| 欧美三级资源在线| 久久国产精品99久久人人澡| 国产农村妇女毛片精品久久麻豆 | 久久久久久久久久看片| www.亚洲免费av| 亚洲综合激情小说| 26uuu色噜噜精品一区| 成人午夜电影小说| 一区二区三区国产豹纹内裤在线| 91精品国产色综合久久不卡电影 | 在线免费观看日本欧美| 另类小说综合欧美亚洲| 中文字幕在线不卡视频| 6080国产精品一区二区| 国产九色sp调教91| 亚洲一区二区视频在线| 久久久精品日韩欧美| 欧美午夜精品久久久| 精品一区精品二区高清| 亚洲欧美国产三级| 久久一区二区视频| 欧美午夜不卡视频| 丁香一区二区三区| 午夜一区二区三区视频| 国产精品五月天| 欧美一级在线视频| 日本高清成人免费播放| 国产精品自拍av| 天天影视涩香欲综合网| 亚洲特级片在线| 久久久美女毛片| 日韩欧美视频在线| 色婷婷av一区二区三区软件| 国产一区二区三区| 丝袜诱惑亚洲看片| 亚洲欧美区自拍先锋| 国产婷婷色一区二区三区在线| 欧美疯狂做受xxxx富婆| 91成人国产精品| 成人手机在线视频| 精品午夜一区二区三区在线观看| 亚洲精品成人在线| 国产精品网友自拍| 欧美激情一区二区三区全黄| 精品噜噜噜噜久久久久久久久试看 | 99九九99九九九视频精品| 久久国产视频网| 美美哒免费高清在线观看视频一区二区 | 成人激情小说网站| 国产精品一二三区在线| 老司机一区二区| 奇米在线7777在线精品| 久久99精品久久久久婷婷| 偷拍一区二区三区| 亚洲第四色夜色| 午夜不卡在线视频| 午夜精品国产更新| 日韩中文字幕麻豆| 视频一区二区三区中文字幕| 亚洲成年人影院| 亚洲成人免费电影| 日本欧美一区二区在线观看| 亚欧色一区w666天堂| 午夜精品久久久久久不卡8050| 亚洲成人午夜影院| 日韩成人免费电影| 开心九九激情九九欧美日韩精美视频电影 | 成人永久免费视频| 成人理论电影网| 99国产精品久| 欧美三级中文字幕在线观看| 欧美日韩一区二区三区四区五区| 欧美视频一区在线观看| 这里只有精品视频在线观看| 日韩欧美亚洲一区二区| 久久亚洲影视婷婷| 国产日产精品1区| 亚洲日本护士毛茸茸| 一区二区三区日韩在线观看| 亚洲国产精品久久不卡毛片| 日韩高清一区在线| 国产综合成人久久大片91| 国产91精品入口| 日本高清不卡aⅴ免费网站| 欧美日韩aaa| 久久综合狠狠综合| 国产精品不卡在线观看| 五月婷婷久久综合| 国产精品18久久久| 色激情天天射综合网| 欧美久久久一区| 国产欧美精品日韩区二区麻豆天美| 亚洲欧洲精品天堂一级| 亚洲成a人v欧美综合天堂| 国内精品免费在线观看| 91农村精品一区二区在线| 欧美一二三区在线| 亚洲欧洲无码一区二区三区| 日本亚洲欧美天堂免费| 99久久99精品久久久久久| 7777精品伊人久久久大香线蕉经典版下载 | 美女精品自拍一二三四| 99久久伊人久久99| 欧美电影免费观看高清完整版在线观看| 日本一区二区三区国色天香| 亚洲你懂的在线视频| 日本不卡一区二区| 成人av资源在线| 日韩欧美精品在线视频| 亚洲精品少妇30p| 黄一区二区三区| 欧美日韩精品三区| 国产精品美女久久久久久久久 | 精品国产电影一区二区 | 久久精品男人天堂av| 亚洲一区二区三区国产| 国产精品亚洲一区二区三区妖精 | 久久精品72免费观看| 日本久久一区二区| 久久久久久久久久久久电影| 日韩黄色片在线观看| 色婷婷av一区二区三区软件| 欧美激情一区二区在线| 久久男人中文字幕资源站| 午夜精品aaa| 91福利在线导航| 亚洲视频一区二区免费在线观看| 黑人精品欧美一区二区蜜桃| 91精品国产综合久久福利| 亚洲综合色噜噜狠狠| 99精品久久久久久| 国产精品乱人伦| 成人黄色大片在线观看| 久久夜色精品国产噜噜av | 日韩免费观看高清完整版| 亚洲高清免费视频| 91久久人澡人人添人人爽欧美| 中文字幕不卡在线播放| 国产麻豆精品久久一二三| 精品国偷自产国产一区| 免费亚洲电影在线| 91精品国产综合久久小美女| 亚洲va欧美va人人爽| 欧美日韩国产一区| 亚洲风情在线资源站| 欧美日韩亚洲另类| 视频一区欧美日韩| 91麻豆精品91久久久久同性|