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

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

?? graphicsexampleframe.java

?? 164個完整的Java代碼,資源比較大
?? JAVA
字號:
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.graphics;import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.event.*;import java.awt.print.*;/** * This class displays one or more GraphicsExample objects in a * Swing JFrame and a JTabbedPane */public class GraphicsExampleFrame extends JFrame {    public GraphicsExampleFrame(final GraphicsExample[] examples) {	super("GraphicsExampleFrame");	Container cpane = getContentPane();   // Set up the frame 	cpane.setLayout(new BorderLayout());	final JTabbedPane tpane = new JTabbedPane(); // And the tabbed pane 	cpane.add(tpane, BorderLayout.CENTER);	// Add a menubar	JMenuBar menubar = new JMenuBar();         // Create the menubar	this.setJMenuBar(menubar);                 // Add it to the frame	JMenu filemenu = new JMenu("File");        // Create a File menu	menubar.add(filemenu);                     // Add to the menubar	JMenuItem print = new JMenuItem("Print");  // Create a Print item	filemenu.add(print);                       // Add it to the menu	JMenuItem quit = new JMenuItem("Quit");    // Create a Quit item	filemenu.add(quit);                        // Add it to the menu	// Tell the Print menu item what to do when selected	print.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) {		    // Get the currently displayed example, and call 		    // the print method (defined below)		    print(examples[tpane.getSelectedIndex()]);		}	    });	// Tell the Quit menu item what to do when selected	quit.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) { System.exit(0); }	    });	// In addition to the Quit menu item, also handle window close events	this.addWindowListener(new WindowAdapter() {		public void windowClosing(WindowEvent e) { System.exit(0); }	    });	// Insert each of the example objects into the tabbed pane	for(int i = 0; i < examples.length; i++) {	    GraphicsExample e = examples[i];	    tpane.addTab(e.getName(), new GraphicsExamplePane(e));	}    }    /**     * This inner class is a custom Swing component that displays     * a GraphicsExample object.     */    public class GraphicsExamplePane extends JComponent {	GraphicsExample example;  // The example to display	Dimension size;           // How much space it requires		public GraphicsExamplePane(GraphicsExample example) {	    this.example = example;	    size = new Dimension(example.getWidth(), example.getHeight());	}	/** Draw the component and the example it contains */	public void paintComponent(Graphics g) {	    g.setColor(Color.white);                    // set the background	    g.fillRect(0, 0, size.width, size.height);  // to white	    g.setColor(Color.black);             // set a default drawing color	    example.draw((Graphics2D) g, this);  // ask example to draw itself	}	// These methods specify how big the component must be	public Dimension getPreferredSize() { return size; }	public Dimension getMinimumSize() { return size; }    }    /** This method is invoked by the Print menu item */    public void print(final GraphicsExample example) {	// Start off by getting a printer job to do the printing	PrinterJob job = PrinterJob.getPrinterJob();	// Wrap the example in a Printable object (defined below)	// and tell the PrinterJob that we want to print it	job.setPrintable(new PrintableExample(example));	// Display the print dialog to the user	if (job.printDialog()) {	    // If they didn't cancel it, then tell the job to start printing	    try {		job.print();	    }	    catch(PrinterException e) {		System.out.println("Couldn't print: " + e.getMessage());	    }	}    }    /**     * This inner class implements the Printable interface in order to print     * a GraphicsExample object.     **/    class PrintableExample implements Printable  {	GraphicsExample example;  // The example to print	// The constructor.  Just remember the example	public PrintableExample(GraphicsExample example) {	    this.example = example;	}	/**	 * This method is called by the PrinterJob to print the example	 **/	public int print(Graphics g, PageFormat pf, int pageIndex) {	    // Tell the PrinterJob that there is only one page	    if (pageIndex != 0) return NO_SUCH_PAGE;	    // The PrinterJob supplies us a Graphics object to draw with.	    // Anything drawn with this object will be sent to the printer.	    // The Graphics object can safely be cast to a Graphics2D object.	    Graphics2D g2 = (Graphics2D)g;	    // Translate to skip the left and top margins.	    g2.translate(pf.getImageableX(), pf.getImageableY());	    // Figure out how big the printable area is, and how big	    // the example is.	    double pageWidth = pf.getImageableWidth();	    double pageHeight = pf.getImageableHeight();	    double exampleWidth = example.getWidth();	    double exampleHeight = example.getHeight();	    // Scale the example if needed	    double scalex = 1.0, scaley = 1.0;	    if (exampleWidth > pageWidth) scalex = pageWidth/exampleWidth;	    if (exampleHeight > pageHeight) scaley = pageHeight/exampleHeight;	    double scalefactor = Math.min(scalex, scaley);	    if (scalefactor != 1) g2.scale(scalefactor, scalefactor);	    // Finally, call the draw() method of the example, passing in	    // the Graphics2D object for the printer	    example.draw(g2, GraphicsExampleFrame.this);	    // Tell the PrinterJob that we successfully printed the page	    return PAGE_EXISTS;	}    }    /**      * The main program.  Use Java reflection to load and instantiate     * the specified GraphicsExample classes, then create a     * GraphicsExampleFrame to display them.     **/    public static void main(String[] args) {	GraphicsExample[] examples = new GraphicsExample[args.length];	// Loop through the command line arguments	for(int i=0; i < args.length; i++) {	    // The class name of the requested example	    String classname = args[i];	    	    // If no package is specified, assume it is in this package	    if (classname.indexOf('.') == -1)		classname = "com.davidflanagan.examples.graphics."+args[i];	    // Try to instantiate the named GraphicsExample class	    try {		Class exampleClass = Class.forName(classname);		examples[i] = (GraphicsExample) exampleClass.newInstance();	    }	    catch (ClassNotFoundException e) {  // unknown class		System.err.println("Couldn't find example: "  + classname);		System.exit(1);	    }	    catch (ClassCastException e) {      // wrong type of class		System.err.println("Class " + classname + 				   " is not a GraphicsExample");		System.exit(1);	    }	    catch (Exception e) {  // class doesn't have a public constructor		// catch InstantiationException, IllegalAccessException		System.err.println("Couldn't instantiate example: " +				   classname);		System.exit(1);	    }	}	// Now create a window to display the examples in, and make it visible	GraphicsExampleFrame f = new GraphicsExampleFrame(examples);	f.pack();	f.setVisible(true);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区久久久| 成人三级伦理片| 国产精品亚洲一区二区三区在线| 9i在线看片成人免费| 69堂成人精品免费视频| 国产精品久久国产精麻豆99网站| 天堂久久一区二区三区| 99久免费精品视频在线观看 | 国产在线精品一区二区夜色| 99精品国产热久久91蜜凸| 欧美va亚洲va| 午夜精品久久久久久久久久久| 粉嫩av一区二区三区粉嫩 | 99国产精品久久| 精品成人a区在线观看| 午夜精品久久久久久| 色狠狠桃花综合| 亚洲欧洲精品一区二区三区不卡| 精品一区二区在线播放| 日韩午夜在线播放| 亚洲bt欧美bt精品777| 91在线观看一区二区| 亚洲国产岛国毛片在线| 国产精品99久久久久久似苏梦涵| 欧美一区二区不卡视频| 日韩国产高清影视| 欧美日韩不卡视频| 亚洲一区二区三区四区的| av资源网一区| 日韩一区日韩二区| 波多野结衣一区二区三区 | 99在线热播精品免费| 欧美亚洲禁片免费| 99久精品国产| 欧美国产禁国产网站cc| 国产原创一区二区| 精品蜜桃在线看| 久久99精品一区二区三区| 91麻豆精品国产自产在线观看一区 | 日韩午夜精品电影| 国产精品影视在线观看| 精品日本一线二线三线不卡| 男女男精品视频| 精品久久久久香蕉网| 国产一区二区成人久久免费影院 | 日本一区二区成人| 成人免费视频播放| 亚洲丝袜制服诱惑| 欧美性猛片aaaaaaa做受| 性欧美疯狂xxxxbbbb| 69久久夜色精品国产69蝌蚪网| 美女网站色91| 国产色91在线| 日本韩国欧美国产| 日韩精品亚洲一区| 久久久久久久久97黄色工厂| 成人在线综合网| 一区二区三区影院| 91精品蜜臀在线一区尤物| 国产专区欧美精品| 日韩美女精品在线| 3d动漫精品啪啪一区二区竹菊| 麻豆精品在线视频| 中文字幕免费不卡在线| 欧美影院午夜播放| 久久国产精品第一页| 国产精品不卡视频| 777久久久精品| 成人午夜伦理影院| 午夜成人免费电影| 日本一二三四高清不卡| 欧美日韩综合色| 国产夫妻精品视频| 亚洲一区二区三区四区在线 | 亚洲欧美一区二区在线观看| 欧美日韩国产色站一区二区三区| 国产主播一区二区三区| 伊人色综合久久天天| 日韩欧美你懂的| 色综合欧美在线视频区| 理论电影国产精品| 亚洲精品乱码久久久久久黑人 | 精品少妇一区二区三区日产乱码| 成人一级视频在线观看| 日韩不卡一区二区三区| 亚洲视频综合在线| 久久久三级国产网站| 精品视频一区三区九区| 成人免费视频视频在线观看免费| 日韩电影在线观看一区| 亚洲人被黑人高潮完整版| 久久久久久久久99精品| 在线成人高清不卡| 一本一本大道香蕉久在线精品| 国产经典欧美精品| 精品在线播放午夜| 亚洲特黄一级片| 欧美日韩免费观看一区二区三区| 国产精品夜夜嗨| 日本美女一区二区三区| 欧美tickling网站挠脚心| 欧美自拍丝袜亚洲| 日韩激情视频在线观看| 国产视频一区在线观看| 日韩一区二区精品葵司在线| 欧美网站一区二区| 91福利精品第一导航| 色偷偷88欧美精品久久久| 不卡大黄网站免费看| 国产成人啪午夜精品网站男同| 韩日av一区二区| 国内精品久久久久影院薰衣草| 日韩国产高清影视| 日韩不卡一区二区三区 | 极品少妇一区二区| 人禽交欧美网站| 蜜桃精品在线观看| 蜜臀91精品一区二区三区| 欧美xfplay| 成人黄动漫网站免费app| 久久不见久久见免费视频7| 日韩国产欧美一区二区三区| 午夜免费欧美电影| 日韩精品视频网| 免费一级片91| 国内精品国产成人| 国产精品一二三四区| 成人h版在线观看| 99久久久久久99| 色综合咪咪久久| 欧美日韩久久久一区| 91精品久久久久久久久99蜜臂| 日韩一级成人av| ww亚洲ww在线观看国产| 久久影院视频免费| 国产精品国产三级国产普通话三级| 国产精品伦理一区二区| 亚洲另类色综合网站| 午夜精品123| 国产一区二区在线视频| hitomi一区二区三区精品| 在线观看三级视频欧美| 日韩欧美一二区| 日本一区二区三区四区在线视频 | 欧美精品色综合| 337p日本欧洲亚洲大胆色噜噜| 欧美激情一区不卡| 亚洲一本大道在线| 狠狠网亚洲精品| 色婷婷综合五月| 精品乱人伦一区二区三区| 国产精品国产三级国产aⅴ无密码| 亚洲乱码精品一二三四区日韩在线| 五月激情综合网| 国产91精品露脸国语对白| 欧美日韩亚洲国产综合| 久久久亚洲午夜电影| 亚洲国产欧美日韩另类综合| 国产一区二区三区四| 欧美午夜一区二区三区| 久久影院午夜片一区| 亚洲成人一区在线| 国产精品白丝jk黑袜喷水| 欧美日本韩国一区二区三区视频| 久久久高清一区二区三区| 亚洲国产精品尤物yw在线观看| 国产一区二区不卡在线| 欧美日本韩国一区二区三区视频 | 欧美一级一级性生活免费录像| 中文字幕精品三区| 免费在线一区观看| 欧美中文字幕一二三区视频| 欧美激情一区二区三区不卡| 麻豆一区二区三区| 欧美午夜精品久久久久久孕妇| 久久九九99视频| 麻豆视频一区二区| 在线观看91精品国产麻豆| 亚洲激情图片qvod| 成人免费观看视频| 久久综合久久鬼色中文字| 日韩高清一区二区| 欧美色图在线观看| 亚洲黄色免费电影| 97久久精品人人爽人人爽蜜臀| www精品美女久久久tv| 奇米影视一区二区三区| 欧美三级在线播放| 亚洲综合在线第一页| 99精品欧美一区二区蜜桃免费| 久久免费看少妇高潮| 美女高潮久久久| 日韩丝袜情趣美女图片| 亚洲v日本v欧美v久久精品| 色综合视频在线观看| 亚洲欧美另类久久久精品2019| 99re这里只有精品首页| 亚洲欧美在线另类| 91麻豆精品秘密| 亚洲美女视频在线|