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

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

?? fontchooser.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.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.event.*;import com.davidflanagan.examples.gui.ItemChooser;/** * This is a JDialog subclass that allows the user to select a font, in any * style and size, from the list of available fonts on the system.  The  * dialog is modal. Display it with show(); this method does not return * until the user dismisses the dialog.  When show() returns, call  * getSelectedFont() to obtain the user's selection.  If the user clicked the * dialog's "Cancel" button, getSelectedFont() will return null. **/public class FontChooser extends JDialog {    // These fields define the component properties    String family;           // The name of the font family    int style;               // The font style    int size;                // The font size    Font selectedFont;       // The Font they correspond to    // This is the list of all font families on the system    String[] fontFamilies;    // The various Swing components used in the dialog    ItemChooser families, styles, sizes;    JTextArea preview;    JButton okay, cancel;    // The names to appear in the "Style" menu    static final String[] styleNames = new String[] {	"Plain", "Italic", "Bold", "BoldItalic"    };    // The style values that correspond to those names    static final Integer[] styleValues = new Integer[] {	new Integer(Font.PLAIN), new Integer(Font.ITALIC),	new Integer(Font.BOLD), new Integer(Font.BOLD+Font.ITALIC)    };    // The size "names" to appear in the size menu    static final String[] sizeNames = new String[] {	"8", "10", "12", "14", "18", "20", "24", "28", "32", 	"40", "48", "56", "64", "72"    };    // This is the default preview string displayed in the dialog box    static final String defaultPreviewString = 	"ABCDEFGHIJKLMNOPQRSTUVWXYZ\n" + 	"abcdefghijklmnopqrstuvwxyz\n" + 	"1234567890!@#$%^&*()_-=+[]{}<,.>\n" +	"The quick brown fox jumps over the lazy dog";    /** Create a font chooser dialog for the specified frame. */    public FontChooser(Frame owner) {	super(owner, "Choose a Font");  // Set dialog frame and title	// This dialog must be used as a modal dialog.  In order to be used	// as a modeless dialog, it would have to fire a PropertyChangeEvent	// whenever the selected font changed, so that applications could be 	// notified of the user's selections.	setModal(true);		// Figure out what fonts are available on the system	GraphicsEnvironment env =	    GraphicsEnvironment.getLocalGraphicsEnvironment();	fontFamilies = env.getAvailableFontFamilyNames();	// Set initial values for the properties	family = fontFamilies[0];	style = Font.PLAIN;	size = 18;	selectedFont = new Font(family, style, size);	// Create ItemChooser objects that allow the user to select font	// family, style, and size.	families = new ItemChooser("Family", fontFamilies, null, 0,				   ItemChooser.COMBOBOX);	styles = new ItemChooser("Style", styleNames, styleValues, 0,				 ItemChooser.COMBOBOX);	sizes = new ItemChooser("Size", sizeNames,null,4,ItemChooser.COMBOBOX);	// Now register event listeners to handle selections	families.addItemChooserListener(new ItemChooser.Listener() {		public void itemChosen(ItemChooser.Event e) {		    setFontFamily((String)e.getSelectedValue());		}	    });	styles.addItemChooserListener(new ItemChooser.Listener() {		public void itemChosen(ItemChooser.Event e) {		    setFontStyle(((Integer)e.getSelectedValue()).intValue());		}	    });	sizes.addItemChooserListener(new ItemChooser.Listener() {		public void itemChosen(ItemChooser.Event e) {		   setFontSize(Integer.parseInt((String)e.getSelectedValue()));		}	    });	// Create a component to preview the font.	preview = new JTextArea(defaultPreviewString, 5, 40);	preview.setFont(selectedFont);	// Create buttons to dismiss the dialog, and set handlers on them	okay = new JButton("Okay");	cancel = new JButton("Cancel");	okay.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) { hide(); }	    });	cancel.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) {		    selectedFont = null;		    hide();		}	    });		// Put the ItemChoosers in a Box 	Box choosersBox = Box.createHorizontalBox();	choosersBox.add(Box.createHorizontalStrut(15));	choosersBox.add(families);	choosersBox.add(Box.createHorizontalStrut(15));	choosersBox.add(styles);	choosersBox.add(Box.createHorizontalStrut(15));	choosersBox.add(sizes);	choosersBox.add(Box.createHorizontalStrut(15));	choosersBox.add(Box.createGlue());	// Put the dismiss buttons in another box	Box buttonBox = Box.createHorizontalBox();	buttonBox.add(Box.createGlue());	buttonBox.add(okay);	buttonBox.add(Box.createGlue());	buttonBox.add(cancel);	buttonBox.add(Box.createGlue());	// Put the choosers at the top, the buttons at the bottom, and	// the preview in the middle.	Container contentPane = getContentPane();	contentPane.add(new JScrollPane(preview), BorderLayout.CENTER);	contentPane.add(choosersBox, BorderLayout.NORTH);	contentPane.add(buttonBox, BorderLayout.SOUTH);	// Set the dialog size based on the component size.	pack();    }    /**     * Call this method after show() to obtain the user's selection.  If the     * user used the "Cancel" button, this will return null     **/    public Font getSelectedFont() { return selectedFont; }    // These are other property getter methods    public String getFontFamily() { return family; }    public int getFontStyle() { return style; }    public int getFontSize() { return size; }    // The property setter methods are a little more complicated.    // Note that none of these setter methods update the corresponding    // ItemChooser components as they ought to.    public void setFontFamily(String name) { 	family = name; 	changeFont();    }    public void setFontStyle(int style) {	this.style = style;	changeFont();    }    public void setFontSize(int size) {	this.size = size;	changeFont();    }    public void setSelectedFont(Font font) {	selectedFont = font;	family = font.getFamily();	style = font.getStyle();	size = font.getSize();	preview.setFont(font);    }    // This method is called when the family, style, or size changes    protected void changeFont() {	selectedFont = new Font(family, style, size);	preview.setFont(selectedFont);    }    // Override this inherited method to prevent anyone from making us modeless    public boolean isModal() { return true; }    /** This inner class demonstrates the use of FontChooser */    public static class Demo {	public static void main(String[] args) {	    // Create some components and a FontChooser dialog	    final JFrame frame = new JFrame("demo");	    final JButton button = new JButton("Push Me!");	    final FontChooser chooser = new FontChooser(frame);	    	    // Handle button clicks	    button.addActionListener(new ActionListener() {		    public void actionPerformed(ActionEvent e) {			// Pop up the dialog			chooser.show();			// Get the user's selection			Font font = chooser.getSelectedFont();			// If not cancelled, set the button font			if (font != null) button.setFont(font);		    }		});	    	    // Display the demo	    frame.getContentPane().add(button);	    frame.setSize(200, 100);	    frame.show();	}    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情深爱一区二区| 成人禁用看黄a在线| 亚洲午夜精品17c| 亚洲综合一区二区| 亚洲国产sm捆绑调教视频 | 26uuu国产日韩综合| 91精品在线观看入口| 欧美一区二区三区白人| 欧美不卡一区二区| 亚洲国产精品国自产拍av| 国产精品青草久久| 亚洲精品日产精品乱码不卡| 一区二区免费看| 视频在线观看91| 精品写真视频在线观看| 国内成+人亚洲+欧美+综合在线| 国产成人综合视频| 色狠狠综合天天综合综合| 欧美日韩视频一区二区| 日韩一区二区麻豆国产| 国产精品国产三级国产aⅴ中文| 亚洲欧美乱综合| 毛片基地黄久久久久久天堂| 国产精品香蕉一区二区三区| 色老头久久综合| 欧美一区二区三区性视频| 久久久久99精品一区| 一区二区三区日韩精品视频| 美女高潮久久久| 91美女在线看| 亚洲精品一区二区三区99| 亚洲欧洲www| 精品一区二区三区香蕉蜜桃| av毛片久久久久**hd| 91精品国产综合久久久蜜臀图片| 国产免费观看久久| 免费高清在线一区| 一本到高清视频免费精品| 粉嫩一区二区三区在线看| 国产精品日日摸夜夜摸av| 久久久亚洲欧洲日产国码αv| 亚洲日本在线天堂| 国产美女主播视频一区| 欧美夫妻性生活| 一区二区久久久久久| 高清不卡一区二区| 日韩免费一区二区三区在线播放| 亚洲精品中文字幕乱码三区| 风间由美一区二区三区在线观看 | 精品女同一区二区| 亚洲成人动漫精品| 日本高清不卡在线观看| 中文字幕成人在线观看| 国产一区二区精品久久99| 制服丝袜国产精品| 婷婷开心激情综合| 色天天综合色天天久久| 中文字幕一区二区三区在线播放 | 欧美国产精品久久| 国产精品系列在线播放| 欧美不卡一区二区三区四区| 免费观看30秒视频久久| 911精品国产一区二区在线| 一区二区三区在线免费播放| 一本久道久久综合中文字幕| 亚洲特黄一级片| 91亚洲精品一区二区乱码| 中文字幕日韩欧美一区二区三区| 福利电影一区二区| 中文字幕免费在线观看视频一区| 国产成人av一区二区三区在线| 日韩欧美国产一区二区在线播放 | 婷婷开心久久网| 欧美日韩国产小视频| 亚洲成a人v欧美综合天堂| 欧美性欧美巨大黑白大战| 亚洲制服欧美中文字幕中文字幕| 91免费国产在线| 亚洲精品一卡二卡| 在线观看网站黄不卡| 亚洲大型综合色站| 欧美一二区视频| 国产一区欧美二区| 中文字幕精品一区二区三区精品| caoporn国产一区二区| 亚洲男人天堂一区| 欧美精品粉嫩高潮一区二区| 美洲天堂一区二卡三卡四卡视频| 精品国产一区久久| 成人国产电影网| 五月综合激情网| ww久久中文字幕| 色综合色狠狠综合色| 蜜臀av亚洲一区中文字幕| 久久久久国产成人精品亚洲午夜| 99久久精品国产麻豆演员表| 中文字幕制服丝袜成人av| 亚洲aaa精品| 国产寡妇亲子伦一区二区| 中文字幕永久在线不卡| 在线视频综合导航| 经典三级视频一区| 亚洲日穴在线视频| 欧美大尺度电影在线| 成人免费不卡视频| 日韩激情视频在线观看| 国产日韩欧美精品电影三级在线 | 91麻豆国产在线观看| 奇米在线7777在线精品| 国产精品国产自产拍在线| 欧美一区二区在线不卡| 91小宝寻花一区二区三区| 九九国产精品视频| 亚洲国产你懂的| 国产精品免费aⅴ片在线观看| 6080午夜不卡| av电影天堂一区二区在线观看| 日韩中文字幕av电影| 亚洲欧洲美洲综合色网| 日韩欧美国产麻豆| 欧美三级日本三级少妇99| 成人国产免费视频| 激情五月激情综合网| 丝袜亚洲另类欧美| 亚洲精品午夜久久久| 国产精品色婷婷久久58| 欧美电影免费观看高清完整版在 | 久久综合精品国产一区二区三区| 欧洲av在线精品| 91影视在线播放| 成人av小说网| 国产99久久久国产精品潘金 | 一区二区三区四区av| 国产精品黄色在线观看| 国产欧美日韩激情| 久久综合成人精品亚洲另类欧美| 6080日韩午夜伦伦午夜伦| 欧美三级在线播放| 在线精品视频免费观看| 色先锋aa成人| 91网上在线视频| 97精品久久久午夜一区二区三区| 国产·精品毛片| 国产+成+人+亚洲欧洲自线| 国产成人午夜精品影院观看视频 | 欧美日韩精品高清| 91久久精品一区二区三| 91在线视频18| 日本韩国欧美在线| 欧美视频在线一区二区三区| 欧美日韩国产免费一区二区| 欧美色图免费看| 在线播放视频一区| 欧美一区二区免费观在线| 日韩欧美在线1卡| 久久久噜噜噜久久中文字幕色伊伊 | 久久99精品久久久久婷婷| 久久国产剧场电影| 麻豆成人久久精品二区三区小说| 麻豆精品一区二区三区| 国产综合色产在线精品| 国产91精品久久久久久久网曝门| 成人av网在线| 欧洲一区二区av| 日韩欧美精品在线| 中文字幕精品一区二区三区精品| 国产精品短视频| 亚洲午夜精品久久久久久久久| 婷婷亚洲久悠悠色悠在线播放 | 成人中文字幕在线| 91丨九色porny丨蝌蚪| 欧美午夜在线观看| 精品久久久久久久久久久院品网 | 欧美成人午夜电影| 国产欧美精品一区aⅴ影院| 一二三区精品福利视频| 日本人妖一区二区| 成人一道本在线| 欧美色国产精品| 亚洲少妇屁股交4| 调教+趴+乳夹+国产+精品| 国产一区二区精品在线观看| 91色在线porny| 精品欧美一区二区久久| 亚洲人成影院在线观看| 日韩经典中文字幕一区| 成人美女视频在线观看18| 欧美在线观看18| 久久久久久久久久美女| 亚洲.国产.中文慕字在线| 国产真实乱对白精彩久久| 欧美四级电影网| 中文字幕va一区二区三区| 日本视频中文字幕一区二区三区| 18涩涩午夜精品.www| 中文字幕中文字幕一区| 激情五月激情综合网| 欧美丝袜丝交足nylons图片| 欧美国产丝袜视频| 久久精品av麻豆的观看方式|