Tutorials to .com

Tutorials to .com » Jsp » Application » jdk1.3 and jdk1.4 the swing component of the Chinese display solution

jdk1.3 and jdk1.4 the swing component of the Chinese display solution

Print View , by: iSee ,Total views: 14 ,Word Count: 677 ,Date: Sun, 23 Aug 2009 Time: 10:07 PM

jdk1.3 and jdk1.4 the swing component of the Chinese display has always been a headache thing.

To solve this problem, I used 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);
put ( "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 ( "Table.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 (Font font) (
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);
put ( "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 Font getFont () (
return _font;
)

)

In the building in which to do so:

/ / /

JOfficeUIManager _UIManager = new JOfficeUIManager ( "Simsun", 0,12);

_UIManager.setFont ();

/ / /

On it.

I have only been tested under the Chinese Windows.

In other platforms, you may need to have Arial font.

bootcool@163.net


Java Application / Other Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.