📄 uiborder.java
字号:
import java.awt.Font;
import java.util.Enumeration;
import javax.swing.*;
import javax.swing.plaf.FontUIResource;
public class UIBorder
{
public static void setSystemUI()
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (InstantiationException e)
{
e.printStackTrace();
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
catch (UnsupportedLookAndFeelException e)
{
e.printStackTrace();
}
}
public static void myUI()
{
try
{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
}
catch (Exception ex)
{
ex.printStackTrace();
}
initGlobalFontSetting("新细明", 12);
}
public static void initGlobalFontSetting(String font, int size)
{
for (Enumeration keys = UIManager.getDefaults().keys();
keys.hasMoreElements(); )
{
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource)
{
FontUIResource rs = (FontUIResource) value;
Font fontRes = new Font(font, rs.getStyle() , size);
UIManager.put(key, new FontUIResource(fontRes));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -