JDK1.3 and JDK1.4 SWING components have always been a very headache.
In order to solve this problem, I use this method.
Import java.awt. *; import javax.swing.UIManager;
Public Class Jofficeuimanager Extends UIManager {
Public font _font; private static string _name; private static int _style; private static int _size;
Public Jofficeuimanager (String name, int style, int size) {_name = name; _Style = style; _size = size; if (_font == null) _font = new font (name, style, size);
Public JofficeUimanager (font font) {_font = font;
Public void setFont () {PUT ("Button.Font", _ font; PUT ("Togglebutton.Font", _ font); PUT ("Radiobutton.Font", _ font); PUT ("Checkbox.Font", _ font); PUT ("colorchooser.font", _ font); PUT ("TOGGLEBUTTON.FONT", _ font); PUT ("ComboBox.Font", _ font; put ("ComboBoxItem.font", _ font); PUT ("INTERNALFRAME.TITLEFONT ", _font); put (" label.font ", _ font); put (" list.font ", _ font); put (" menubar.font ", _ font); PUT (" menu.font ", _ font); PUT ("Menuitem.Font", _ font; "radiobuttonmenuitem.font", _ font); PUT ("CheckBoxMenuItem.font", _ font); PUT ("PopupMenu.font", _ font); PUT ("optionpane.font" , _font); PUT ("PANEL.FONT", _ font); PUT ("ProgressBar.font", _ font); PUT ("scrollpane.font", _ font); PUT ("Viewport", _ font); PUT ("Tabbedpane .font ", _ font); //put (" TableHeader.Font ", _ font); PUT (" textfield.font ", _ font); PUT (" passwordfiled.font ", _font); put ("textarea.font", _ font); PUT "Textpane.font", _ font); PUT ("editorpane.font", _ font); PUT ("Titledborder.Font", _ font); PUT ("Toolbar.Font", _ font); PUT ("Tooltip.Font", _font); PUT ("tree.font", _ font);
Public void setfont ("Button.Font", font); PUT ("ToggleButton.Font", Font; PUT ("Radiobutton.Font", Font); PUT ("Checkbox.Font", Font PUT ("Colorchooser.Font", Font); PUT ("ToggleButton.Font", Font); PUT ("ComboBox.Font", Font); PUT ("ComboBoxItem.font", Font); PUT ("InternalFrame .titlefont ", font); PUT (" LABEL.FONT ", FONT); PUT (" List.Font ", Font); PUT (" MenuBar.Font ", Font); PUT (" Menu.Font ", font) PUT ("Menuitem.Font", Font; PUT ("RadiobuttonMenuItem.font", Font); PUT ("CheckBoxMenuItem.font", font); PUT ("Popupmenu.Font", Font); PUT ("Optionpane. FONT ", FONT"; PUT ("ProgressBar.Font", Font; PUT ("Scrollpane.Font", Font); PUT ("ViewPort", Font); PUT "Tabbedpane.Font", Font; PUT ("TableHeader.Font", Font; PUT ("TEXTFIELD.FONT", FONT); PUT ("PasswordFiled.Font", Font); PUT ("TextArea.font", Font); PUT ("TextPane.Font", Font); PUT ("EditorPane.Font", PUT ("Titledborder.Font", Font; PUT ("Toolbar.Font", Font); PUT ("Tooltip.Font", Font); PUT ("Tree.Font", Font);} public font Getfont () {return _font;}}
Constructing this:
///
Jofficeuimanager _uimanager = New Jofficeuimanager ("SIMSUN", 0, 12);
_UIManager.SetFont ();
///
Yes.
I only did test under the Chinese Windows.
Under other platforms, there may be a Song Body Library.
Bootcool@163.net