📄 calc.java~11~
字号:
package calc;import javax.swing.UIManager;import java.awt.*;public class Calc { boolean packFrame = false; /*java默认风格*************/private static String Metal ="javax.swing.plaf.metal.MetalLookAndFeel";/*motif风格**********/private static String Motif ="com.sun.java.swing.plaf.motif.MotifLookAndFeel";/*Windows风格**************/private static String Windows ="com.sun.java.swing.plaf.windows.WindowsLookAndFeel";/*Borland风格 **************/private static String Borland = "com.borland.plaf.borland.BorlandLookAndFeel";/*当前系统风格****************///UIManager.getSystemLookAndFeelClassName() //Construct the application public Calc() { MFrame frame = new MFrame(); //Validate frames that have preset sizes //Pack frames that have useful preferred size info, e.g. from their layout if (packFrame) { frame.pack(); } else { frame.validate(); } //Center the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = frame.getSize(); if (frameSize.height > screenSize.height) { frameSize.height = screenSize.height; } if (frameSize.width > screenSize.width) { frameSize.width = screenSize.width; } frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); frame.setVisible(true); } public static void main(String[] args) { try { UIManager.setLookAndFeel(Motif); } catch(Exception e) { e.printStackTrace(); } new Calc(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -