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

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

?? deiteldrawing.java

?? java的一些教程 大家看看,很有用的
?? JAVA
字號:
// DeitelDrawing.java
// DeitelDrawing is a drawing program that uses, MVC, a
// multiple-document interface and Java2D.
package com.deitel.advjhtp1.drawing;

// Java core packages
import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.beans.*;

// Java extension packages
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;

public class DeitelDrawing extends JFrame {
   
   private JMenuBar menuBar;
   private JMenu fileMenu, helpMenu;

   private Action newAction, openAction, 
      exitAction, aboutAction;

   private JMenuItem saveMenuItem, saveAsMenuItem;
   
   private JToolBar toolBar;
   private JPanel toolBarPanel, frameToolBarPanel;
   private JDesktopPane desktopPane;
   
   private SplashScreen splashScreen;

   // DeitelDrawing constructor
   public DeitelDrawing() 
   {
      super( "DeitelDrawing" );
      
      // set icon for JFrame's upper-left-hand corner
      ImageIcon icon = new ImageIcon( 
         DeitelDrawing.class.getResource( "images/icon.png" ) );      
      setIconImage( icon.getImage() );
      
      showSplashScreen();      
      
      // do not hide window when close button clicked
      setDefaultCloseOperation( 
         WindowConstants.DO_NOTHING_ON_CLOSE );

      // create JDesktopPane for MDI
      desktopPane = new JDesktopPane();
      
      // show contents when dragging JInternalFrames
      desktopPane.setDragMode( JDesktopPane.LIVE_DRAG_MODE );

      // create Action for creating new drawings
      Icon newIcon = new ImageIcon( 
         DeitelDrawing.class.getResource( "images/new.gif" ) );   
      
      newAction = new AbstractDrawingAction( "New", newIcon,
         "Create New Drawing", new Integer( 'N' ) ) {

         public void actionPerformed( ActionEvent event )
         {
            createNewWindow();
         }
      };
      
      // create Action for opening existing drawings
      Icon openIcon = new ImageIcon( 
         DeitelDrawing.class.getResource( "images/open.gif" ) );
      
      openAction = new AbstractDrawingAction( "Open", openIcon,
         "Open Existing Drawing", new Integer( 'O' ) ) {
         
         public void actionPerformed( ActionEvent event ) 
         { 
            DrawingInternalFrame frame = createNewWindow();
            
            if ( !frame.openDrawing() ) 
               frame.close();
         }
      };

      // create Action for exiting application
      Icon exitIcon = new ImageIcon( 
         DeitelDrawing.class.getResource( "images/exit.gif" ) );
      
      exitAction = new AbstractDrawingAction( "Exit", exitIcon,
         "Exit Application", new Integer( 'X' ) ) {
         
         public void actionPerformed( ActionEvent event ) 
         { 
            exitApplication(); 
         }
      };

      // create Action for opening About dialog
      Icon aboutIcon = new ImageIcon(
         DeitelDrawing.class.getResource( "images/about.gif" ) );
      
      aboutAction = new AbstractDrawingAction( "About", 
         aboutIcon, "About Application", new Integer( 'b' ) ) {
            
         public void actionPerformed( ActionEvent event ) 
         {
            JOptionPane.showMessageDialog( DeitelDrawing.this, 
               "DeitelDrawing v1.0.\n Copyright " +
               "2002. Deitel & Associates, Inc." ); 
         }
      };

      // create File menu and set its mnemonic
      fileMenu = new JMenu( "File" );
      fileMenu.setMnemonic( 'F' );
      
      // create Help menu and set its mnemonic
      helpMenu = new JMenu( "Help" );
      helpMenu.setMnemonic( 'H' );
      
      menuBar = new JMenuBar();

      // add New Drawing and Open Drawing actions to 
      // File menu and remove their icons
      fileMenu.add( newAction ).setIcon( null );
      fileMenu.add( openAction ).setIcon( null );
      
      // create JMenuItems for saving drawings; these 
      // JMenuItems will invoke the save Actions for the 
      // current DrawingInternalFrame
      saveMenuItem = new JMenuItem( "Save" );
      saveAsMenuItem = new JMenuItem( "Save As" );
      
      // add Save, Save As and Close JMenuItems to File menu
      fileMenu.add( saveMenuItem );
      fileMenu.add( saveAsMenuItem );
      
      fileMenu.addSeparator();
      
      // add Exit action to File menu and remove its icon
      fileMenu.add( exitAction ).setIcon( null );
      
      // add About action to Help menu and remove its icon
      helpMenu.add ( aboutAction ).setIcon( null );

      // add File and Help menus to JMenuBar
      menuBar.add( fileMenu );
      menuBar.add( helpMenu );

      // set Frame's JMenuBar
      setJMenuBar( menuBar );

      // create application JToolBar
      toolBar = new JToolBar();
      
      // disable JToolBar floating
      toolBar.setFloatable( false );
      
      // add New Drawing and Open Drawing actions to JToolBar
      toolBar.add( newAction );
      toolBar.add( openAction );
      
      toolBar.addSeparator();
      
      // add Exit action to JToolBar
      toolBar.add( exitAction );
      
      toolBar.addSeparator();
      
      // add About action to JToolBar
      toolBar.add( aboutAction );
      
      // add toolBar and desktopPane to ContentPane
      getContentPane().add( toolBar, BorderLayout.NORTH );
      getContentPane().add( desktopPane, BorderLayout.CENTER );

      // add WindowListener for windowClosing event
      addWindowListener( 
         new WindowAdapter() {
         
            public void windowClosing( WindowEvent event ) 
            { 
               exitApplication(); 
            }
         }
      );
      
      // wait for SplashScreen to go away
      while ( splashScreen.isVisible() ) {
         
         try {
            Thread.sleep( 10 );
         }
         
         // handle exception 
         catch ( InterruptedException interruptedException ) {
            interruptedException.printStackTrace();
         }
      }

      // set initial JFrame size
      setSize( 640, 480 );
      
      // position application window
      centerWindowOnScreen();
      
      // make application visible
      setVisible( true );
      
      // create new, empty drawing window
      createNewWindow();   
      
   } // end DeitelDrawing constructor

   // create new DrawingInternalFrame
   private DrawingInternalFrame createNewWindow() 
   {  
      // create new DrawingInternalFrame
      DrawingInternalFrame frame = 
         new DrawingInternalFrame( "Untitled Drawing" );
   
      // add listener for InternalFrame events
      frame.addInternalFrameListener( 
         new DrawingInternalFrameListener() );
      
      // make DrawingInternalFrame opaque
      frame.setOpaque( true );
      
      // add DrawingInternalFrame to desktopPane
      desktopPane.add( frame );
      
      // make DrawingInternalFrame visible
      frame.setVisible( true );
      
      // select new DrawingInternalFrame
      try { 
         frame.setSelected( true ); 
      } 
      
      // handle exception selecting DrawingInternalFrame 
      catch ( PropertyVetoException vetoException ) { 
         vetoException.printStackTrace(); 
      }
      
      // return reference to newly created DrawingInternalFrame
      return frame;
   }
   
   // InternalFrameAdapter to listen for InternalFrame events
   private class DrawingInternalFrameListener 
      extends InternalFrameAdapter {

      // when DrawingInternalFrame is closing disable 
      // appropriate Actions
      public void internalFrameClosing( 
         InternalFrameEvent event ) 
      { 
         DrawingInternalFrame frame = 
            ( DrawingInternalFrame ) event.getSource();
         
         // frame closes successfully, disable Save menu items
         if ( frame.close() ) {           
            saveMenuItem.setAction( null );
            saveAsMenuItem.setAction( null );
         }
      }

      // when DrawingInternalFrame is activated, make its JToolBar
      // visible and set JMenuItems to DrawingInternalFrame Actions
      public void internalFrameActivated( 
         InternalFrameEvent event ) 
      {
         DrawingInternalFrame frame = 
            ( DrawingInternalFrame ) event.getSource();
         
         // set saveMenuItem to DrawingInternalFrame's saveAction
         saveMenuItem.setAction( frame.getSaveAction() );
         saveMenuItem.setIcon( null );
         
         // set saveAsMenuItem to DrawingInternalFrame's 
         // saveAsAction
         saveAsMenuItem.setAction( frame.getSaveAsAction() );
         saveAsMenuItem.setIcon( null );
      }
   }    
   
   // close each DrawingInternalFrame to let user save drawings 
   // then exit application
   private void exitApplication() 
   {
      // get array of JInternalFrames from desktopPane
      JInternalFrame frames[] = desktopPane.getAllFrames();
      
      // keep track of DrawingInternalFrames that do not close
      boolean allFramesClosed = true;
      
      // select and close each DrawingInternalFrame
      for ( int i = 0; i < frames.length; i++ ) {
         DrawingInternalFrame nextFrame = 
            ( DrawingInternalFrame ) frames[ i ];
         
         // select current DrawingInternalFrame
         try { 
            nextFrame.setSelected( true ); 
         } 
         
         // handle exception when selecting DrawingInternalFrame 
         catch ( PropertyVetoException vetoException ) { 
            vetoException.printStackTrace(); 
         }
      
         // close DrawingInternalFrame and update allFramesClosed
         allFramesClosed = allFramesClosed && nextFrame.close();
      }
      
      // exit application only if all frames were closed
      if ( allFramesClosed ) 
         System.exit( 0 );
   
   } // end method exitApplication
   
   // display application's splash screen
   public void showSplashScreen()
   {
      // create ImageIcon for logo
      Icon logoIcon = new ImageIcon( 
         getClass().getResource( "images/deitellogo.png" ) );
      
      // create new JLabel for logo
      JLabel logoLabel = new JLabel( logoIcon );
      
      // set JLabel background color
      logoLabel.setBackground( Color.white );
      
      // set splash screen border
      logoLabel.setBorder( 
         new MatteBorder( 5, 5, 5, 5, Color.black ) );
      
      // make logoLabel opaque
      logoLabel.setOpaque( true );
      
      // create SplashScreen for logo
      splashScreen = new SplashScreen( logoLabel ); 
      
      // show SplashScreen for 3 seconds
      splashScreen.showSplash( 3000 );     
   
   } // end method showSplashScreen
   
   // center application window on user's screen
   private void centerWindowOnScreen()
   {
      // get Dimension of user's screen
      Dimension screenDimension = 
         Toolkit.getDefaultToolkit().getScreenSize();
      
      // use screen width and height and application width
      // and height to center application on user's screen
      int width = getSize().width;
      int height = getSize().height;
      int x = ( screenDimension.width - width ) / 2 ;
      int y = ( screenDimension.height - height ) / 2 ;
      
      // place application window at screen's center
      setBounds( x, y, width, height );
   }

   // execute application
   public static void main( String args[] ) 
   {      
      new DeitelDrawing();
   }
}

/***************************************************************
 * (C) Copyright 2002 by Deitel & Associates, Inc. and         *
 * Prentice Hall. All Rights Reserved.                         *
 *                                                             *
 * DISCLAIMER: The authors and publisher of this book have     *
 * used their best efforts in preparing the book. These        *
 * efforts include the development, research, and testing of   *
 * the theories and programs to determine their effectiveness. *
 * The authors and publisher make no warranty of any kind,     *
 * expressed or implied, with regard to these programs or to   *
 * the documentation contained in these books. The authors     *
 * and publisher shall not be liable in any event for          *
 * incidental or consequential damages in connection with, or  *
 * arising out of, the furnishing, performance, or use of      *
 * these programs.                                             *
 ***************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品福利视频网站| 国产成人免费视频网站| 欧美日韩精品一区视频| 亚洲图片另类小说| 91麻豆.com| 亚洲精品高清视频在线观看| 91婷婷韩国欧美一区二区| 国产精品国产三级国产aⅴ原创 | 有坂深雪av一区二区精品| 91视频精品在这里| 亚洲美女在线国产| 成人国产精品免费观看视频| 国产欧美一区在线| 国产一区二区h| 国产蜜臀av在线一区二区三区| 国产99久久久国产精品潘金| 国产精品区一区二区三区| 99精品一区二区三区| 亚洲欧美日韩在线| 欧美视频一区二区三区在线观看| 亚洲综合图片区| 欧美日韩国产一区二区三区地区| 三级欧美在线一区| 欧美日韩不卡一区二区| 日本中文在线一区| 久久影院视频免费| 成人天堂资源www在线| 亚洲欧洲精品天堂一级| 欧美视频在线一区二区三区 | 日韩视频永久免费| 国产乱妇无码大片在线观看| 欧美激情中文字幕一区二区| 国产**成人网毛片九色 | 日韩欧美亚洲另类制服综合在线| 精品一区二区精品| 中文欧美字幕免费| 91福利视频在线| 日韩电影在线看| www国产精品av| 国产电影一区在线| 一区二区激情视频| 日韩丝袜情趣美女图片| 成人永久aaa| 一二三区精品福利视频| 91精品国产综合久久福利软件| 国内偷窥港台综合视频在线播放| 日本一区二区三区电影| 色av一区二区| 美国十次综合导航| 国产精品美女久久久久久2018| 欧美自拍丝袜亚洲| 久久国产福利国产秒拍| 中文字幕亚洲不卡| 这里只有精品电影| 北岛玲一区二区三区四区| 亚洲一二三区不卡| 精品国产欧美一区二区| 成人深夜在线观看| 日韩精品欧美精品| 国产精品美女久久久久久久久久久 | 欧美日韩亚洲另类| 蜜臀av性久久久久蜜臀aⅴ| 国产欧美日韩视频在线观看| 欧美日韩综合在线| 国产成人在线观看免费网站| 亚洲午夜精品网| 国产婷婷一区二区| 在线观看日产精品| 国产一区二区三区在线看麻豆| 亚洲日穴在线视频| 日韩欧美你懂的| 91麻豆免费看片| 国产美女视频一区| 亚洲成人av资源| 中文字幕国产一区二区| 欧美日韩免费一区二区三区视频| 国产精品亚洲а∨天堂免在线| 亚洲综合在线五月| 日本一区二区三区久久久久久久久不 | 激情欧美一区二区| 亚洲国产精品欧美一二99| 国产人伦精品一区二区| 欧美一级视频精品观看| 91丨九色丨蝌蚪富婆spa| 国产一本一道久久香蕉| 丝袜美腿高跟呻吟高潮一区| 国产精品福利影院| 久久久美女毛片| 欧美一区二区三区免费大片| 一本大道久久a久久综合| 国产成人在线视频免费播放| 美脚の诱脚舐め脚责91| 亚洲一区二区在线播放相泽| 国产精品入口麻豆九色| 日韩女同互慰一区二区| 欧美日韩精品欧美日韩精品一综合| 成人免费看片app下载| 久久99精品久久久| 午夜精品久久久久久久久久久| 中文字幕视频一区二区三区久| 日韩一级高清毛片| 欧美男人的天堂一二区| 一本久久a久久精品亚洲| 国产成人av一区二区三区在线| 欧美a级一区二区| 亚洲www啪成人一区二区麻豆| 中文字幕欧美一| 国产日韩一级二级三级| 精品理论电影在线观看| 日韩视频免费观看高清完整版在线观看| 99精品欧美一区二区三区小说| 国产精品18久久久久久久久久久久| 日韩vs国产vs欧美| 亚欧色一区w666天堂| 亚洲图片一区二区| 亚洲中国最大av网站| 亚洲精品乱码久久久久久黑人| 国产精品久久久久久久岛一牛影视| 精品国产1区2区3区| 日韩一级完整毛片| 日韩欧美综合在线| 制服丝袜亚洲精品中文字幕| 欧美久久久久免费| 7777精品伊人久久久大香线蕉完整版| 在线观看亚洲精品视频| 91国偷自产一区二区使用方法| av色综合久久天堂av综合| 成人动漫一区二区| 成人97人人超碰人人99| 东方欧美亚洲色图在线| 激情小说欧美图片| 精品亚洲porn| 日日夜夜一区二区| 日韩国产精品91| 香蕉影视欧美成人| 日本va欧美va精品| 另类调教123区| 极品美女销魂一区二区三区| 精品一区二区三区免费| 国产精品香蕉一区二区三区| 国产剧情一区在线| 粉嫩av一区二区三区在线播放| 国产电影一区在线| 成人app下载| www.一区二区| 99久久婷婷国产| 色婷婷av一区二区三区之一色屋| 欧美性色黄大片| 91精品免费观看| 久久综合九色综合97婷婷| 欧美韩国一区二区| 最新国产の精品合集bt伙计| 玉米视频成人免费看| 视频一区视频二区在线观看| 麻豆成人久久精品二区三区小说| 狠狠色丁香婷婷综合| 成人午夜视频网站| 色美美综合视频| 欧美一级视频精品观看| 久久奇米777| 中文字幕亚洲视频| 亚洲成人777| 理论片日本一区| 国产成人综合在线| 91精品福利在线| 91精品欧美综合在线观看最新| 精品国产a毛片| 一区视频在线播放| 图片区小说区区亚洲影院| 麻豆freexxxx性91精品| 丁香六月久久综合狠狠色| 成人国产精品免费观看动漫| 色av一区二区| 欧美色倩网站大全免费| 久久婷婷综合激情| 日韩一区在线播放| 日韩精品欧美精品| 国产a精品视频| 欧日韩精品视频| 久久综合精品国产一区二区三区| 亚洲天堂成人网| 久久精品国产亚洲一区二区三区| 成人丝袜18视频在线观看| 欧美视频中文字幕| 国产午夜三级一区二区三| 亚洲一二三区不卡| 国产麻豆精品95视频| 91久久国产最好的精华液| 精品福利在线导航| 国产精品久久久久永久免费观看| 亚洲成人黄色小说| 国产精品一区二区久激情瑜伽 | 亚洲卡通欧美制服中文| 午夜不卡av免费| 成人免费视频视频| 日韩欧美一级二级三级久久久| 依依成人综合视频| 成人午夜电影网站| 欧美va在线播放| 石原莉奈在线亚洲三区|