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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? showcomponent.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.gui;import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.beans.*;import java.lang.reflect.*;import java.util.Vector;/** * This class is a program that uses reflection and JavaBeans introspection to * create a set of named components, set named properties on those components, * and display them.  It allows the user to view the components using any * installed look-and-feel.  It is intended as a simple way to experiment with * AWT and Swing components, and to view a number of the other examples * developed in this chapter.  It also demonstrates frames, menus, and the * JTabbedPane component. **/public class ShowComponent {    // The main program    public static void main(String[] args) {	// Process the command line to get the components to display	Vector components = getComponentsFromArgs(args);	// Create a frame (a window) to display them in	JFrame frame = new JFrame("ShowComponent");	// Handle window close requests by exiting the VM	frame.addWindowListener(new WindowAdapter() { // Anonymous inner class		public void windowClosing(WindowEvent e) { System.exit(0); }	    });		// Set up a menu system that allows the user to select the 	// look-and-feel of the component from a list of installed PLAFs	JMenuBar menubar = new JMenuBar();      // Create a menubar	frame.setJMenuBar(menubar);             // Tell the frame to display it	JMenu plafmenu = createPlafMenu(frame); // Create a menu	menubar.add(plafmenu);                  // Add the menu to the menubar	// Create a JTabbedPane to display each of the components	JTabbedPane pane = new JTabbedPane();	// Now add each component as a tab of the tabbed pane	// Use the unqualified component classname as the tab text	for(int i = 0; i < components.size(); i++) {	    Component c = (Component)components.elementAt(i);	    String classname = c.getClass().getName();	    String tabname = classname.substring(classname.lastIndexOf('.')+1);	    pane.addTab(tabname, c);	}	// Add the tabbed pane to the frame.  Note the call to getContentPane()	// This is required for JFrame, but not for most Swing components	frame.getContentPane().add(pane);	// Set the frame size and pop it up	frame.pack();              // Make frame as big as its kids need 	frame.setVisible(true);    // Make the frame visible on the screen	// The main() method exits now but the Java VM keeps running because	// all AWT programs automatically start an event-handling thread.    }    /**     * This static method queries the system to find out what Pluggable     * Look-and-Feel (PLAF) implementations are available.  Then it creates a     * JMenu component that lists each of the implementations by name and     * allows the user to select one of them using JRadioButtonMenuItem     * components.  When the user selects one, the selected menu item     * traverses the component hierarchy and tells all components to use the     * new PLAF.     **/    public static JMenu createPlafMenu(final JFrame frame) {	// Create the menu	JMenu plafmenu = new JMenu("Look and Feel");	// Create an object used for radio button mutual exclusion	ButtonGroup radiogroup = new ButtonGroup();  	// Look up the available look and feels	UIManager.LookAndFeelInfo[] plafs =	    UIManager.getInstalledLookAndFeels();	// Loop through the plafs, and add a menu item for each one	for(int i = 0; i < plafs.length; i++) {	    String plafName = plafs[i].getName();	    final String plafClassName = plafs[i].getClassName();	    // Create the menu item	    JMenuItem item = plafmenu.add(new JRadioButtonMenuItem(plafName));	    	    // Tell the menu item what to do when it is selected	    item.addActionListener(new ActionListener() {		    public void actionPerformed(ActionEvent e) {			try {			    // Set the new look and feel			    UIManager.setLookAndFeel(plafClassName);			    // Tell each component to change its look-and-feel			    SwingUtilities.updateComponentTreeUI(frame);			    // Tell the frame to resize itself to the its			    // children's new desired sizes			    frame.pack();			}			catch(Exception ex) { System.err.println(ex); }		    }		});	    // Only allow one menu item to be selected at once	    radiogroup.add(item);  	}	return plafmenu;    }    /**     * This method loops through the command line arguments looking for     * class names of components to create and property settings for those     * components in the form name=value.  This method demonstrates      * reflection and JavaBeans introspection as they can be applied to     * dynamically created GUIs     **/    public static Vector getComponentsFromArgs(String[] args) {	Vector components = new Vector();       // List of components to return	Component component = null;             // The current component 	PropertyDescriptor[] properties = null; // Properties of the component	Object[] methodArgs = new Object[1];    // We'll use this below      nextarg:  // This is a labeled loop	for(int i = 0; i < args.length; i++) {  // Loop through all arguments	    // If the argument does not contain an equal sign, then it is	    // a component class name.  Otherwise it is a property setting	    int equalsPos = args[i].indexOf('=');	    if (equalsPos == -1) {  // Its the name of a component		try {		    // Load the named component class		    Class componentClass = Class.forName(args[i]);		    // Instantiate it to create the component instance		    component = (Component)componentClass.newInstance();		    // Use JavaBeans to introspect the component		    // And get the list of properties it supports		    BeanInfo componentBeanInfo =			Introspector.getBeanInfo(componentClass);		    properties = componentBeanInfo.getPropertyDescriptors();		}		catch(Exception e) {  		    // If any step failed, print an error and exit		    System.out.println("Can't load, instantiate, " +				       "or introspect: " + args[i]);		    System.exit(1);		}		// If we succeeded, store the component in the vector		components.addElement(component);	    }	    else { // The arg is a name=value property specification 		String name =args[i].substring(0, equalsPos); // property name		String value =args[i].substring(equalsPos+1); // property value		// If we don't have a component to set this property on, skip!		if (component == null) continue nextarg;		// Now look through the properties descriptors for this		// component to find one with the same name.		for(int p = 0; p < properties.length; p++) {		    if (properties[p].getName().equals(name)) {			// Okay, we found a property of the right name.			// Now get its type, and the setter method			Class type = properties[p].getPropertyType();			Method setter = properties[p].getWriteMethod();			// Check if property is read-only!			if (setter == null) {  			    System.err.println("Property " + name+					       " is read-only");			    continue nextarg;  // continue with next argument			}			// Try to convert the property value to the right type			// We support a small set of common property types here			// Store the converted value in an Object[] so it can			// be easily passed when we invoke the property setter			try {			    if (type == String.class) { // no conversion needed				methodArgs[0] = value;   			    }			    else if (type == int.class) {     // String to int				methodArgs[0] = Integer.valueOf(value);			    }			    else if (type == boolean.class) { // to boolean				methodArgs[0] = Boolean.valueOf(value);			    }			    else if (type == Color.class) {   // to Color				methodArgs[0] = Color.decode(value);			    }			    else if (type == Font.class) {    // String to Font				methodArgs[0] = Font.decode(value);			    }			    else {				// If we can't convert, ignore the property				System.err.println("Property " + name + 						   " is of unsupported type " +						   type.getName());				continue nextarg;			    }			}			catch (Exception e) {			    // If conversion failed, continue with the next arg			    System.err.println("Can't convert  '" + value +					       "' to type " + type.getName() +					       " for property " + name);			    continue nextarg;			}			// Finally, use reflection to invoke the property			// setter method of the component we created, and pass			// in the converted property value.			try { setter.invoke(component, methodArgs); }			catch (Exception e) {			    System.err.println("Can't set property: " + name);			}			// Now go on to next command-line arg			continue nextarg;  		    }		}		// If we get here, we didn't find the named property		System.err.println("Warning: No such property: " + name);	    }	}	return components;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一二精品视频| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 日韩和欧美一区二区三区| 精品卡一卡二卡三卡四在线| 91伊人久久大香线蕉| 免费日本视频一区| 亚洲综合激情网| 中文字幕免费不卡| 欧美成va人片在线观看| 欧美亚洲综合久久| 成人av在线资源| 国产在线视频一区二区| 日韩中文字幕麻豆| 一区二区在线免费观看| 国产精品女上位| 久久青草国产手机看片福利盒子 | 欧美mv日韩mv亚洲| 精品视频在线免费观看| 成人的网站免费观看| 国产一区二区不卡在线| 日本视频中文字幕一区二区三区| 亚洲人被黑人高潮完整版| 国产亚洲午夜高清国产拍精品| 欧美精品久久天天躁| 欧美调教femdomvk| 一本一道久久a久久精品| 成人av网站大全| 成人午夜看片网址| 国产精品一区一区三区| 国产在线一区观看| 国产乱码精品一区二区三 | 日产欧产美韩系列久久99| 亚洲猫色日本管| ...xxx性欧美| 最新不卡av在线| 中文字幕中文在线不卡住| 中文字幕av一区 二区| 亚洲国产精品国自产拍av| 日本一区二区三区国色天香 | 99久久777色| av动漫一区二区| 91免费观看视频| 在线精品观看国产| 欧美蜜桃一区二区三区| 欧美理论在线播放| 欧美一级搡bbbb搡bbbb| 日韩精品一区二区三区老鸭窝| 欧美一级片免费看| 久久久久久久性| 国产精品久久综合| 亚洲另类中文字| 婷婷综合五月天| 久久精品国产**网站演员| 精品一区二区三区不卡| 国产一区在线精品| 高清免费成人av| 波多野结衣在线一区| 一本色道**综合亚洲精品蜜桃冫| 色婷婷久久一区二区三区麻豆| 色天使色偷偷av一区二区| 欧美日韩久久一区二区| 日韩亚洲电影在线| 国产日韩视频一区二区三区| 中文字幕欧美一区| 亚洲第一综合色| 国产一区二区三区精品欧美日韩一区二区三区| 国产乱子轮精品视频| av亚洲精华国产精华| 欧美日韩情趣电影| 久久亚区不卡日本| 亚洲精品欧美激情| 免费观看91视频大全| 国产精品一区二区视频| 日本久久一区二区| 日韩欧美成人一区二区| 国产精品天干天干在线综合| 亚洲一区二区四区蜜桃| 韩国女主播成人在线| 色狠狠色噜噜噜综合网| 欧美一级二级三级乱码| 中文字幕制服丝袜一区二区三区| 亚洲成人777| 国产91丝袜在线播放| 欧美视频精品在线| 久久精品日韩一区二区三区| 亚洲高清三级视频| 国产不卡免费视频| 欧美美女直播网站| 国产精品污www在线观看| 日本人妖一区二区| 91日韩一区二区三区| 欧美v国产在线一区二区三区| 亚洲人成网站在线| 国内成人精品2018免费看| 91久久精品网| 久久精品水蜜桃av综合天堂| 香蕉久久夜色精品国产使用方法 | 在线电影国产精品| 国产精品每日更新| 极品美女销魂一区二区三区 | 在线看日韩精品电影| 久久精品一区二区三区不卡牛牛| 亚洲国产wwwccc36天堂| 99久久精品费精品国产一区二区| 精品日韩一区二区三区 | 日韩不卡在线观看日韩不卡视频| 国产999精品久久久久久| 日韩午夜电影av| 亚洲一区视频在线| 91小宝寻花一区二区三区| 国产亚洲欧美激情| 久国产精品韩国三级视频| 8x8x8国产精品| 亚洲一区二区三区在线播放| 99re在线精品| 国产精品看片你懂得| 国产福利91精品一区二区三区| 欧美一区二区视频在线观看 | 久久精品国产一区二区三区免费看| 色婷婷久久久亚洲一区二区三区| 国产农村妇女毛片精品久久麻豆 | 精品伊人久久久久7777人| 欧美日韩一区中文字幕| 一区二区三区美女| 一本色道久久加勒比精品| 成人免费视频在线观看| av资源网一区| 国产精品欧美综合在线| 国产成人在线视频网站| 久久久国产综合精品女国产盗摄| 久久99久国产精品黄毛片色诱| 制服丝袜在线91| 免费在线视频一区| 欧美一级二级三级蜜桃| 久久精品国产99国产精品| 精品奇米国产一区二区三区| 久久精品国产免费看久久精品| 欧美一级二级三级乱码| 蜜桃视频免费观看一区| www久久久久| 懂色av噜噜一区二区三区av| 欧美激情中文不卡| 99精品热视频| 玉米视频成人免费看| 欧美日韩一区二区在线观看| 亚洲bt欧美bt精品777| 欧美日韩美女一区二区| 美女爽到高潮91| 久久午夜羞羞影院免费观看| 高清免费成人av| 亚洲人快播电影网| 欧美日韩你懂的| 精品一区二区三区在线播放视频| 亚洲精品一区二区三区蜜桃下载| 国产精品一区不卡| 国产精品二三区| 欧美亚洲国产一区二区三区| 亚洲gay无套男同| 精品成人免费观看| 成人aaaa免费全部观看| 亚洲一区av在线| 日韩免费观看2025年上映的电影| 国产精品一品二品| 亚洲视频你懂的| 欧美一区二区三区在线| 国产一区二区三区视频在线播放| 中文成人综合网| 欧美三级日韩在线| 国产精品综合在线视频| 亚洲摸摸操操av| 欧美va在线播放| 91视频观看免费| 裸体一区二区三区| 国产欧美日韩三级| 欧美日韩日本视频| 国产成a人亚洲精| 舔着乳尖日韩一区| 国产欧美日韩视频在线观看| 欧美色图天堂网| 国产福利精品导航| 天天做天天摸天天爽国产一区| 久久久久久久久久久黄色| 欧美亚日韩国产aⅴ精品中极品| 看电影不卡的网站| 亚洲另类在线一区| 欧美mv日韩mv国产| 欧美日韩小视频| 成人午夜短视频| 蜜乳av一区二区| 亚洲欧美日韩中文字幕一区二区三区 | 五月天国产精品| 国产精品久久毛片| 日韩欧美精品在线视频| 色婷婷香蕉在线一区二区| 国产一区999| 奇米精品一区二区三区四区 | 亚洲综合一区在线| 国产欧美日韩精品a在线观看| 欧美美女视频在线观看| av在线不卡免费看|