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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(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 helpMenu = new JMenu("Help");           // Create Help menu

    fileMenu.setMnemonic('F');                    // Create shortcut
    elementMenu.setMnemonic('E');                 // 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"));

    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

    menuBar.add(fileMenu);                        // Add the file menu
    menuBar.add(elementMenu);                     // Add the element 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);

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

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

  public Color getElementColor()
  { 
    return elementColor; 
  }

  public int getElementType()
  { 
    return elementType; 
  }

  // File actions
  private FileAction newAction, openAction, closeAction,
                     saveAction, saveAsAction, printAction;
  // Element type actions
  private TypeAction lineAction, rectangleAction, circleAction,
                     curveAction;
  // 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 JToolBar toolBar = new JToolBar();               // Window toolbar
  private JMenuItem aboutItem;
  StatusBar statusBar = new StatusBar();                   // Window status bar
  Sketcher theApp;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产.欧美.日韩| 国产精品污网站| 欧洲一区在线观看| 色悠久久久久综合欧美99| 91免费国产在线| 色丁香久综合在线久综合在线观看| 99久久婷婷国产综合精品电影 | 日韩精品一二区| 午夜精品久久久久影视| 一区二区三区中文字幕电影| 亚洲精品一二三四区| 粉嫩av亚洲一区二区图片| 久久国产精品72免费观看| 加勒比av一区二区| 国产精一品亚洲二区在线视频| 国产精品一二三四区| 成人少妇影院yyyy| 色婷婷久久综合| 欧美日韩视频在线一区二区 | 国产亚洲美州欧州综合国| 国产校园另类小说区| 国产精品网站在线观看| 亚洲男人都懂的| 天堂va蜜桃一区二区三区漫画版| 免费观看30秒视频久久| 国产乱人伦偷精品视频免下载| 成人av中文字幕| 欧美日韩中文字幕一区二区| 在线不卡的av| 国产亚洲一区二区三区在线观看 | 三级一区在线视频先锋| 精品一区二区三区在线播放视频 | 在线观看日韩电影| 日韩精品中午字幕| 日本一区二区三级电影在线观看| 亚洲人成在线观看一区二区| 首页综合国产亚洲丝袜| 国产福利不卡视频| 色999日韩国产欧美一区二区| 欧美精品久久一区二区三区 | 精品一二三四在线| 不卡的电视剧免费网站有什么| 欧美性生活一区| 精品国产一区二区三区久久影院| 中文字幕中文字幕一区| 日av在线不卡| 99久久99久久精品国产片果冻| 7777精品伊人久久久大香线蕉的| 久久老女人爱爱| 亚洲国产日韩a在线播放| 韩国精品一区二区| 在线观看日韩高清av| 久久嫩草精品久久久精品| 一区二区三区视频在线看| 久久成人精品无人区| 色婷婷av一区二区三区软件| 日韩免费视频一区二区| 亚洲黄色小说网站| 国产盗摄一区二区| 这里只有精品99re| 亚洲裸体在线观看| 国产乱人伦偷精品视频不卡| 欧美日本一区二区| 亚洲欧洲国产专区| 国产剧情一区二区| 91麻豆精品国产无毒不卡在线观看| 国产精品午夜电影| 国产呦萝稀缺另类资源| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产午夜精品久久| 美女被吸乳得到大胸91| 欧美中文字幕一区| 亚洲视频在线观看一区| 高清国产一区二区三区| 欧美电影免费观看高清完整版| 亚洲图片一区二区| 91色porny蝌蚪| 国产女主播在线一区二区| 老司机午夜精品99久久| 精品污污网站免费看| 亚洲欧洲国产专区| 成人午夜电影久久影院| 久久午夜电影网| 久久精品国产秦先生| 欧美福利电影网| 亚洲成人一二三| 91成人在线观看喷潮| 亚洲天堂免费在线观看视频| 国产成人免费av在线| 久久青草国产手机看片福利盒子| 日本强好片久久久久久aaa| 在线观看亚洲精品| 亚洲综合免费观看高清完整版| 99久久精品国产麻豆演员表| 国产精品久久一级| 春色校园综合激情亚洲| 欧美国产日韩在线观看| 国产成人精品亚洲午夜麻豆| 久久久亚洲精品石原莉奈| 国产呦精品一区二区三区网站| 欧美精品一区在线观看| 九一九一国产精品| 26uuu国产日韩综合| 韩国视频一区二区| 国产日产精品一区| 成人综合婷婷国产精品久久 | 国产精品无码永久免费888| 懂色av中文一区二区三区| 国产喷白浆一区二区三区| 国产成人综合亚洲网站| 国产精品青草久久| 91原创在线视频| 一个色妞综合视频在线观看| 欧美性三三影院| 三级在线观看一区二区| 日韩欧美一级精品久久| 麻豆91免费观看| 久久精品在线观看| 99久久99久久精品国产片果冻| 亚洲男人天堂av| 欧美日韩国产bt| 精品一区二区三区日韩| 国产欧美日韩在线| 色综合久久中文字幕综合网| 亚洲国产精品麻豆| 日韩精品一区二区三区中文精品| 国产原创一区二区| 亚洲色图在线播放| 欧美军同video69gay| 免费高清成人在线| 国产欧美一区二区在线观看| 91网站最新地址| 日本vs亚洲vs韩国一区三区二区 | 国产超碰在线一区| 亚洲天堂2016| 欧美老人xxxx18| 狠狠久久亚洲欧美| 一区在线播放视频| 欧美福利视频导航| 高清在线观看日韩| 亚洲国产成人av好男人在线观看| 日韩欧美一级在线播放| gogo大胆日本视频一区| 午夜一区二区三区视频| 久久久亚洲午夜电影| 色婷婷综合五月| 韩国三级在线一区| 一区二区三区免费| 久久噜噜亚洲综合| 欧美日韩在线一区二区| 国产精品91xxx| 亚洲va天堂va国产va久| 国产欧美一区二区精品忘忧草| 色狠狠色噜噜噜综合网| 国模套图日韩精品一区二区| 亚洲美女屁股眼交| www国产成人免费观看视频 深夜成人网| 成人v精品蜜桃久久一区| 美腿丝袜在线亚洲一区| 亚洲人午夜精品天堂一二香蕉| 欧美tickling挠脚心丨vk| 日本高清不卡aⅴ免费网站| 久久国产精品99精品国产| 一区二区三区四区在线| 国产色91在线| 欧美一区二区视频观看视频| 99国产精品99久久久久久| 久久99国产精品久久99| 亚洲制服丝袜一区| 国产精品久久免费看| 欧美电影免费观看高清完整版在| 在线观看91精品国产入口| 成人18精品视频| 国产一区二区三区观看| 天堂成人国产精品一区| 亚洲品质自拍视频| 日本一区二区三级电影在线观看 | 日韩一二在线观看| 在线亚洲高清视频| www.在线欧美| 国产电影一区在线| 精品亚洲aⅴ乱码一区二区三区| 亚洲成人在线观看视频| 亚洲精品综合在线| 一区在线观看免费| 国产精品欧美精品| 久久精品视频在线看| 精品嫩草影院久久| 欧美一区2区视频在线观看| 欧美性大战久久久久久久蜜臀 | 精品视频在线看| 色综合久久天天综合网| zzijzzij亚洲日本少妇熟睡| 国产一区二区不卡| 精品在线播放免费| 久久成人免费网| 精品在线亚洲视频| 久久99九九99精品| 久久国产精品99久久久久久老狼| 免费成人在线视频观看|