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

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

?? guiresourcebundle.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? 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.io.*;import java.util.*;import java.awt.*;/** * This class extends ResourceBundle and adds methods to retrieve types of * resources commonly used in GUIs.  Additionally, it adds extensibility * by allowing ResourceParser objects to be registered to parse other * resource types. **/public class GUIResourceBundle extends ResourceBundle {    // The root object.  Required to parse certain resource types like Commands    Object root;               // The resource bundle that actually contains the textual resources    // This class is a wrapper around this bundle    ResourceBundle bundle;    /** Create a GUIResourceBundle wrapper around a specified bundle */    public GUIResourceBundle(Object root, ResourceBundle bundle) {	this.root = root;	this.bundle = bundle;    }    /**     * Load a named bundle and create a GUIResourceBundle around it.  This      * constructor takes advantage of the internationalization features of     * the ResourceBundle.getBundle() method.     **/    public GUIResourceBundle(Object root, String bundleName)	throws MissingResourceException    {	this.root = root;	this.bundle = ResourceBundle.getBundle(bundleName);    }    /**     * Create a PropertyResourceBundle from the specified stream and then     * create a GUIResourceBundle wrapper for it     **/    public GUIResourceBundle(Object root, InputStream propertiesStream)        throws IOException    {	this.root = root;	this.bundle = new PropertyResourceBundle(propertiesStream);    }    /**     * Create a PropertyResourceBundle from the specified properties file and     * then create a GUIResourceBundle wrapper for it.     **/    public GUIResourceBundle(Object root, File propertiesFile)         throws IOException    {	this(root, new FileInputStream(propertiesFile));    }    /** This is one of the abstract methods of ResourceBundle */    public Enumeration getKeys() { return bundle.getKeys(); }    /** This is the other abstract method of ResourceBundle */    protected Object handleGetObject(String key)	throws MissingResourceException    {	return bundle.getObject(key);  // simply defer to the wrapped bundle    }        /** This is a property accessor method for our root object */    public Object getRoot() { return root; }    /**      * This method is like the inherited getString() method, except that      * when the named resource is not found, it returns the specified default      * instead of throwing an exception      **/    public String getString(String key, String defaultValue) {	try { return bundle.getString(key); }	catch(MissingResourceException e) { return defaultValue; }    }    /**     * Look up the named resource and parse it as a list of strings separated     * by spaces, tabs, or commas.     **/    public java.util.List getStringList(String key)	throws MissingResourceException    {	String s = getString(key);	StringTokenizer t = new StringTokenizer(s, ", \t", false);	ArrayList list = new ArrayList();	while(t.hasMoreTokens()) list.add(t.nextToken());	return list;    }    /** Like above, but return a default instead of throwing an exception */    public java.util.List getStringList(String key,					java.util.List defaultValue) {	try { return getStringList(key); }	catch(MissingResourceException e) { return defaultValue; }    }    /** Look up the named resource and try to interpret it as a boolean. */    public boolean getBoolean(String key) throws MissingResourceException {	String s = bundle.getString(key);	s = s.toLowerCase();	if (s.equals("true")) return true;	else if (s.equals("false")) return false;	else if (s.equals("yes")) return true;	else if (s.equals("no")) return false;	else if (s.equals("on")) return true;	else if (s.equals("off")) return false;	else {	    throw new MalformedResourceException("boolean", key);	}    }    /** As above, but return the default instead of throwing an exception */    public boolean getBoolean(String key, boolean defaultValue) {	try { return getBoolean(key); }	catch(MissingResourceException e) {	    if (e instanceof MalformedResourceException)		System.err.println("WARNING: " + e.getMessage());	    return defaultValue;	}    }    /** Like getBoolean(), but for integers */    public int getInt(String key) throws MissingResourceException {	String s = bundle.getString(key);		try {	    // Use decode() instead of parseInt() so we support octal	    // and hexadecimal numbers	    return Integer.decode(s).intValue();	} catch (NumberFormatException e) {	    throw new MalformedResourceException("int", key);	}    }    /** As above, but with a default value */    public int getInt(String key, int defaultValue) {	try { return getInt(key); }	catch(MissingResourceException e) {	    if (e instanceof MalformedResourceException)		System.err.println("WARNING: " + e.getMessage());	    return defaultValue;	}    }    /** Return a resource of type double */    public double getDouble(String key) throws MissingResourceException {	String s = bundle.getString(key);		try {	    return Double.parseDouble(s);	} catch (NumberFormatException e) {	    throw new MalformedResourceException("double", key);	}    }    /** As above, but with a default value */    public double getDouble(String key, double defaultValue) {	try { return getDouble(key); }	catch(MissingResourceException e) {	    if (e instanceof MalformedResourceException)		System.err.println("WARNING: " + e.getMessage());	    return defaultValue;	}    }    /** Look up the named resource and convert to a Font */    public Font getFont(String key) throws MissingResourceException {	// Font.decode() always returns a Font object, so we can't check	// whether the resource value was well-formed or not.	return Font.decode(bundle.getString(key));    }    /** As above, but with a default value */    public Font getFont(String key, Font defaultValue) {	try { return getFont(key); }	catch (MissingResourceException e) { return defaultValue; }    }    /** Look up the named resource, and convert to a Color */    public Color getColor(String key) throws MissingResourceException {	try {	    return Color.decode(bundle.getString(key));	}	catch (NumberFormatException e) { 	    // It would be useful to try to parse color names here as well	    // as numeric color specifications	    throw new MalformedResourceException("Color", key);	}    }    /** As above, but with a default value */    public Color getColor(String key, Color defaultValue) {	try { return getColor(key); }	catch(MissingResourceException e) {	    if (e instanceof MalformedResourceException)		System.err.println("WARNING: " + e.getMessage());	    return defaultValue;	}    }    /** A hashtable for mapping resource types to resource parsers */    static HashMap parsers = new HashMap();    /** An extension mechanism: register a parser for new resource types */    public static void registerResourceParser(ResourceParser parser) {	// Ask the ResourceParser what types it can parse	Class[] supportedTypes = parser.getResourceTypes();	// Register it in the hashtable for each of those types	for(int i = 0; i < supportedTypes.length; i++)	    parsers.put(supportedTypes[i], parser);    }    /** Look up a ResourceParser for the specified resource type */    public static ResourceParser getResourceParser(Class type) {	return (ResourceParser) parsers.get(type);    }    /**     * Look for a ResourceParser for the named type, and if one is found,      * ask it to parse and return the named resource      **/    public Object getResource(String key, Class type)	throws MissingResourceException    {	// Get a parser for the specified type	ResourceParser parser = (ResourceParser)parsers.get(type);	if (parser == null) 	    throw new MissingResourceException(                  "No ResourceParser registered for " +		  type.getName() + " resources",		  type.getName(), key);		try {  // Ask the parser to parse the resource	    return parser.parse(this, key, type);	}	catch(MissingResourceException e) {	    throw e;  // Rethrow MissingResourceException exceptions	}	catch(Exception e) {	    // If any other type of exception occurs, convert it to	    // a MalformedResourceException	    String msg = "Malformed " + type.getName() + " resource: " +		key + ": " + e.getMessage();	    throw new MalformedResourceException(msg, type.getName(), key);	}    }    /**     * Like the 2-argument version of getResource, but return a default value     * instead of throwing a MissingResourceException     **/    public Object getResource(String key, Class type, Object defaultValue) {	try {  return getResource(key, type); }	catch (MissingResourceException e) {	    if (e instanceof MalformedResourceException)		System.err.println("WARNING: " + e.getMessage());	    return defaultValue;	}    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人亚洲人成电影网站色| 国产成人高清视频| 国产乱色国产精品免费视频| 成人av在线资源| 日韩欧美一区二区三区在线| 一区二区三区免费看视频| 国产精品99久久不卡二区| 6080国产精品一区二区| 成人免费在线播放视频| 国产福利不卡视频| 欧美成人video| 偷拍一区二区三区四区| 色婷婷综合久久久| 国产精品久久久久久久浪潮网站 | 1024成人网| 国产不卡视频在线观看| 26uuu国产一区二区三区| 视频在线在亚洲| 欧美视频一区二区在线观看| 亚洲伦理在线免费看| 国产69精品一区二区亚洲孕妇| 精品欧美一区二区在线观看| 奇米色一区二区| 6080午夜不卡| 日本vs亚洲vs韩国一区三区二区| 欧美亚洲一区三区| 亚洲成人中文在线| 欧美伦理视频网站| 亚洲va韩国va欧美va精品| 欧日韩精品视频| 午夜视频在线观看一区二区| 欧美日韩国产系列| 天堂影院一区二区| 在线电影欧美成精品| 蜜乳av一区二区| 久久综合色之久久综合| 国产精品中文欧美| 中文字幕第一页久久| 成人网在线播放| 亚洲人成网站影音先锋播放| 欧洲视频一区二区| 日本亚洲电影天堂| 精品国产免费人成在线观看| 国产在线麻豆精品观看| 亚洲国产岛国毛片在线| 色婷婷国产精品久久包臀| 一区二区三区国产豹纹内裤在线 | 日韩av高清在线观看| 日韩欧美国产1| 国产乱码一区二区三区| 国产精品久久久久影院色老大| av不卡一区二区三区| 亚洲成人资源网| 亚洲精品一区在线观看| 99久精品国产| 奇米精品一区二区三区四区| 欧美xxxxxxxxx| aaa国产一区| 日本中文字幕一区二区有限公司| 久久蜜桃av一区精品变态类天堂| 99精品久久99久久久久| 日韩精品午夜视频| 国产精品久久免费看| 91麻豆精品国产91久久久久| 国产高清不卡一区| 亚洲成人黄色小说| 久久精品视频在线免费观看| 色综合中文字幕| 麻豆成人久久精品二区三区红 | 天天免费综合色| 国产欧美综合在线观看第十页| 欧美在线一区二区三区| 精品亚洲国内自在自线福利| 亚洲精品写真福利| 久久一留热品黄| 欧美在线视频全部完| 国产麻豆精品在线| 日日摸夜夜添夜夜添精品视频 | 久久综合精品国产一区二区三区| 99在线精品观看| 精品一区二区在线视频| 亚洲免费观看高清完整 | 日韩视频免费直播| 99久久99久久久精品齐齐| 久草精品在线观看| 婷婷中文字幕一区三区| 亚洲欧洲综合另类在线| 久久久久久久久99精品| 日韩三级高清在线| 欧美日韩国产影片| 91女神在线视频| 国产成人在线视频播放| 麻豆精品在线播放| 天堂va蜜桃一区二区三区 | 欧美日韩视频第一区| 99视频在线观看一区三区| 国产麻豆午夜三级精品| 韩国毛片一区二区三区| 日本中文在线一区| 婷婷中文字幕综合| 视频一区视频二区在线观看| 一区二区三区在线免费视频| 综合色中文字幕| 国产精品久久久久久久裸模| 亚洲国产精品精华液ab| 国产亚洲婷婷免费| 国产午夜精品美女毛片视频| www成人在线观看| 久久日韩精品一区二区五区| 欧美成人午夜电影| 日韩精品一区二区三区三区免费| 日韩写真欧美这视频| 欧美一级搡bbbb搡bbbb| 日韩视频在线永久播放| 欧美一级二级三级蜜桃| 欧美一区二区三区日韩| 日韩欧美123| 欧美xxxx老人做受| 久久久综合网站| 国产精品私人自拍| 亚洲色大成网站www久久九九| 亚洲免费视频中文字幕| 亚洲国产日韩一级| 国产成人福利片| av色综合久久天堂av综合| 99久久精品免费观看| 在线一区二区视频| 91精品国产欧美日韩| 欧美va亚洲va| 国产精品色一区二区三区| 1区2区3区国产精品| 亚洲国产cao| 精品无人码麻豆乱码1区2区| 成人国产精品免费观看视频| 色综合久久88色综合天天6| 欧美日韩不卡一区二区| xf在线a精品一区二区视频网站| 国产精品视频九色porn| 亚洲丶国产丶欧美一区二区三区| 欧美aaaaa成人免费观看视频| 国产精品一二三四| 欧美综合天天夜夜久久| 欧美电视剧免费全集观看| 国产精品久久久久aaaa| 天天亚洲美女在线视频| 国产成人精品网址| 欧美日韩精品一二三区| 久久精品人人做人人爽人人| 亚洲综合丝袜美腿| 国产一区欧美一区| 欧美在线观看禁18| 久久综合网色—综合色88| 亚洲精品免费在线| 精品制服美女丁香| 91久久奴性调教| 国产三级欧美三级日产三级99| 亚洲一二三四久久| 国产传媒日韩欧美成人| 制服丝袜中文字幕亚洲| 国产精品国产自产拍高清av王其 | 丁香婷婷综合激情五月色| 欧美日韩一区二区三区在线看| 精品三级在线看| 一区二区三区在线观看视频| 国产黄色成人av| 日韩一区二区三区高清免费看看| 中文字幕在线免费不卡| 狠狠色狠狠色综合| 日韩丝袜情趣美女图片| 亚洲自拍与偷拍| 不卡一二三区首页| 国产亚洲精久久久久久| 日韩av电影一区| 在线影视一区二区三区| 日韩一区日韩二区| 国产成人日日夜夜| 精品99999| 国产在线播精品第三| 欧美一卡二卡三卡四卡| 亚洲成人免费视| 欧美羞羞免费网站| 亚洲国产中文字幕在线视频综合| 99视频精品全部免费在线| 国产偷国产偷亚洲高清人白洁 | 国产清纯白嫩初高生在线观看91| 奇米影视在线99精品| 欧美猛男超大videosgay| 亚洲久草在线视频| 91丨九色丨国产丨porny| 国产精品欧美久久久久一区二区 | 欧美日韩一区二区在线观看| 亚洲精品福利视频网站| 色综合久久久久久久久| 亚洲精品中文字幕在线观看| 91美女在线视频| 亚洲欧洲中文日韩久久av乱码| 91在线视频免费91| 亚洲综合免费观看高清完整版在线| 在线观看不卡一区| 同产精品九九九|