Swing tip. Set the global font (Sun JDK) Why? Because the default font display in Java is ugly Because skin such as jgoodies does not support Chinese characters by default Because jdk1.4 has a serious bug in mapping Chinese fonts, anyone who has used idea knows that Because only sun's JDK is available, IBM's and Bea's are not suitable for running the client. If you are smart ....
|
// Set global font Public Static Void Initglobalfontsetting (font fnt ){ Fontuiresource fontres = New Fontuiresource (fnt ); For (Enumeration keys = Uimanager. getdefaults (). Keys (); keys. hasmoreelements ();){ Object key = Keys. nextelement (); Object Value = Uimanager. Get (Key ); If (Value instanceof fontuiresource) Uimanager. Put (Key, fontres ); } } |
If you aren't...
Font font = New Font ( " Dialog " , Font. Plain, 12 );
Uimanager. Put ( " Tooltip. Font " , Font );
Uimanager. Put ( " Table. Font " , Font );
Uimanager. Put ( " Tableheader. Font " , Font );
Uimanager. Put ( " Textfield. Font " , Font );
Uimanager. Put ( " ComboBox. Font " , Font );
Uimanager. Put ( " Textfield. Font " , Font );
Uimanager. Put ( " Passwordfield. Font " , Font );
Uimanager. Put ( " Textarea. Font " , Font );
Uimanager. Put ( " Textpane. Font " , Font );
Uimanager. Put ( " Editorpane. Font " , Font );
Uimanager. Put ( " Formattedtextfield. Font " , Font );
Uimanager. Put ( " Button. Font " , Font );
Uimanager. Put ( " Checkbox. Font " , Font );
Uimanager. Put ( " Radiobutton. Font " , Font );
Uimanager. Put ( " Togglebutton. Font " , Font );
Uimanager. Put ( " Progressbar. Font " , Font );
Uimanager. Put ( " Desktopicon. Font " , Font );
Uimanager. Put ( " Titledborder. Font " , Font );
Uimanager. Put ( " Label. Font " , Font );
Uimanager. Put ( " List. Font " , Font );
Uimanager. Put ( " Tabbedpane. Font " , Font );
Uimanager. Put ( " Menubar. Font " , Font );
Uimanager. Put ( " Menu. Font " , Font );
Uimanager. Put ( " Menuitem. Font " , Font );
Uimanager. Put ( " Popupmenu. Font " , Font );
Uimanager. Put ( " Checkboxmenuitem. Font " , Font );
Uimanager. Put ( " Radiobuttonmenuitem. Font " , Font );
Uimanager. Put ( " Spinner. Font " , Font );
Uimanager. Put ( " Tree. Font " , Font );
Uimanager. Put ( " Toolbar. Font " , Font );
Uimanager. Put ( " Optionpane. messagefont " , Font );
Uimanager. Put ( " Optionpane. buttonfont " , Font );