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

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

?? fontchooser.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 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一区二区三区免费野_久草精品视频
欧美午夜精品免费| 国产成人8x视频一区二区| 中文字幕精品一区二区精品绿巨人 | 日日骚欧美日韩| 亚洲一区二区精品3399| 亚洲婷婷在线视频| 国产精品污www在线观看| 久久天天做天天爱综合色| 日韩欧美亚洲另类制服综合在线 | 一区二区三区四区精品在线视频| 日本一区二区视频在线观看| 日本一区二区视频在线观看| 国产精品视频一二三| 国产欧美日韩精品在线| 中文在线一区二区| 亚洲色图视频网站| 亚洲精品菠萝久久久久久久| 亚洲一级二级在线| 日韩高清不卡在线| 麻豆一区二区在线| 国产一区二区导航在线播放| 国产成人aaa| 91免费观看国产| 欧美日韩国产高清一区二区| 欧美精品xxxxbbbb| 久久夜色精品一区| 中文字幕一区二区三| 一区二区三区资源| 男人的天堂亚洲一区| 国产成人av影院| 色哟哟精品一区| 7777精品久久久大香线蕉| 日韩一区二区精品| 国产精品人妖ts系列视频| 一区二区欧美精品| 久久不见久久见免费视频7| 粉嫩aⅴ一区二区三区四区| 日本道色综合久久| 日韩片之四级片| 亚洲天堂久久久久久久| 亚洲www啪成人一区二区麻豆| 韩国女主播成人在线| 一本色道a无线码一区v| 日韩欧美高清在线| 亚洲欧美激情一区二区| 麻豆国产欧美一区二区三区| 成人免费av资源| 日韩午夜三级在线| 亚洲精品乱码久久久久久久久| 裸体一区二区三区| 99re视频精品| 精品国产乱码久久久久久蜜臀| 亚洲狼人国产精品| 韩国视频一区二区| 欧美日韩国产综合草草| 国产精品美女久久福利网站| 日本欧美加勒比视频| www.久久久久久久久| 欧美变态tickle挠乳网站| 一区二区三区中文字幕在线观看| 国产伦精品一区二区三区免费迷| 欧美色综合久久| 亚洲女同一区二区| 成人av影视在线观看| 精品播放一区二区| 奇米精品一区二区三区在线观看| 在线观看一区不卡| 亚洲欧洲无码一区二区三区| 国产麻豆精品一区二区| 日韩欧美一区二区不卡| 伊人婷婷欧美激情| 99视频在线观看一区三区| 久久久国产综合精品女国产盗摄| 美国三级日本三级久久99 | av在线这里只有精品| 精品免费日韩av| 美女爽到高潮91| 日韩午夜av一区| 免费亚洲电影在线| 欧美一卡二卡在线观看| 日韩国产一区二| 56国语精品自产拍在线观看| 午夜伊人狠狠久久| 欧美日韩视频第一区| 婷婷中文字幕一区三区| 在线播放一区二区三区| 青青草97国产精品免费观看| 欧美一区二区在线观看| 九九精品一区二区| 欧美mv日韩mv国产| 国产精品一区免费视频| 国产欧美日韩在线| 高清在线不卡av| 成人欧美一区二区三区在线播放| 97久久超碰国产精品| 一区二区久久久久| 欧美日韩一区不卡| 美洲天堂一区二卡三卡四卡视频| 日韩欧美国产1| 国产成人av影院| 亚洲欧美福利一区二区| 欧美酷刑日本凌虐凌虐| 麻豆免费看一区二区三区| 精品99久久久久久| 成人av电影在线播放| 亚洲国产一二三| 日韩精品一区二区在线| 国产露脸91国语对白| 亚洲人成网站色在线观看| 欧美性videosxxxxx| 久久精品国产色蜜蜜麻豆| 中文字幕乱码亚洲精品一区| 日本乱码高清不卡字幕| 久久精品国产第一区二区三区| 久久精品欧美一区二区三区不卡| 色素色在线综合| 久久国产婷婷国产香蕉| 亚洲一区二区三区国产| 欧美va在线播放| 91麻豆国产自产在线观看| 日韩—二三区免费观看av| 国产亚洲精久久久久久| 欧美日韩高清一区二区三区| 国产一区二区精品久久99| 亚洲精品亚洲人成人网在线播放| 日韩一级成人av| 99视频精品全部免费在线| 免费在线观看日韩欧美| 亚洲欧美日韩中文播放 | 日韩天堂在线观看| 99久久伊人精品| 国产精品一区二区黑丝| 亚洲成人免费观看| 亚洲欧美一区二区视频| 精品日韩一区二区三区免费视频| 色综合久久久久网| 国产成人av电影免费在线观看| 亚洲成av人影院| 亚洲欧洲制服丝袜| 国产清纯美女被跳蛋高潮一区二区久久w| 欧美日韩一卡二卡| 99久久精品情趣| 国产成人在线影院| 久久精品国产亚洲一区二区三区| 亚洲精品国产第一综合99久久 | 美女一区二区久久| 伊人婷婷欧美激情| |精品福利一区二区三区| 久久奇米777| 欧美精品一区二区三区蜜臀| 欧美日韩午夜在线| 色综合久久久久久久久久久| 大胆亚洲人体视频| 高清成人在线观看| 处破女av一区二区| 国产不卡在线一区| 国产成人免费视频| 粉嫩av亚洲一区二区图片| 国产成人精品免费| 国产成人av电影免费在线观看| 国产一区二区在线影院| 紧缚奴在线一区二区三区| 极品少妇xxxx偷拍精品少妇| 毛片av一区二区| 久久99国产精品免费| 久久精品999| 国产一区二区三区四| 国产精品一区二区在线观看网站| 国产精品综合av一区二区国产馆| 国产一区三区三区| 99v久久综合狠狠综合久久| 97精品久久久午夜一区二区三区 | 成人性生交大片免费看中文| 成人在线一区二区三区| 91在线播放网址| 欧美亚洲国产一区二区三区va| 欧美亚州韩日在线看免费版国语版| 在线观看av一区二区| 欧美色视频一区| 欧美成人一区二区三区片免费| 精品处破学生在线二十三| 欧美激情在线观看视频免费| 国产精品成人免费精品自在线观看| 亚洲婷婷在线视频| 污片在线观看一区二区| 精品一区二区免费视频| 国产成人亚洲综合色影视| 99国产精品久久久久久久久久| 91久久国产最好的精华液| 欧美高清激情brazzers| 久久久亚洲精品一区二区三区 | 国产精品午夜春色av| 日韩一区欧美一区| 日日摸夜夜添夜夜添国产精品 | 国产精品自拍网站| 色婷婷精品大视频在线蜜桃视频| 51精品视频一区二区三区| 久久久精品日韩欧美| 亚洲综合丁香婷婷六月香| 国产一区二区电影|