main.java

来自「一个C语言子集的编译器」· Java 代码 · 共 48 行

JAVA
48
字号
package com.king4solomon.homework.compiler.gui;

import javax.swing.*;
import javax.swing.plaf.*;



import java.awt.Font;


public class Main {

	public static void main(String[] args) throws ClassNotFoundException,
			InstantiationException, IllegalAccessException,
			UnsupportedLookAndFeelException {
		// TODO Auto-generated method stub

		/**
		 * 改变当前project所使用的Look&Feel为系统模式,在当前环境下即
		 * com.sun.java.swing.plaf.Windows.WindowsLookAndFeel 未使用try块而是采用throw
		 * unhandled exception抛出异常
		 */
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		setUIFont(new FontUIResource("Dialog", Font.PLAIN, 12));
		HandoutFrame handout = new HandoutFrame("Extended C0 Compiler");
		handout.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		handout.setVisible(true);
		

	}
	public static void setUIFont(javax.swing.plaf.FontUIResource f) {
		//
		// sets the default font for all Swing components.
		// ex.
		//  setUIFont (new
		// javax.swing.plaf.FontUIResource("Serif",Font.ITALIC,12));
		//
		java.util.Enumeration keys = UIManager.getDefaults().keys();
		while (keys.hasMoreElements()) {
			Object key = keys.nextElement();
			Object value = UIManager.get(key);
			if (value instanceof javax.swing.plaf.FontUIResource)
				UIManager.put(key, f);
		}
	}


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?