分析器.java

来自「cmm语言词法分析器的详细源代码和执行程序」· Java 代码 · 共 45 行

JAVA
45
字号
// CMM lexical analyzer application
import java.awt.Toolkit;
import java.awt.Dimension;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
import javax.swing.*;

/**
 * 
 * @author 流浪的鱼 jason_kou@163.com
 */
public class Analyzer {
	public static void main(String[] args) {
		theApp = new Analyzer();
		SwingUtilities.invokeLater(new Runnable() { // Anonymous Runnable class
					// object
					public void run() { // Run method executed in thread
						theApp.creatGUI(); // Call static GUI creator
					}
				});
	}

	private void creatGUI() {
		window = new AnalyzerFrame("CMM Lexical Analyzer");
		Toolkit theKit = window.getToolkit();
		Dimension wndSize = theKit.getScreenSize();

		window.setBounds(wndSize.width / 9, wndSize.height / 9,
				wndSize.width * 4 / 5, wndSize.height * 4 / 5);
		window.setVisible(true);
	}

	class WindowHandler extends WindowAdapter {
		// Handler for window closing event
		public void windowClosing(WindowEvent e) {
		}
	}

	private static AnalyzerFrame window;

	private static Analyzer theApp;
}


⌨️ 快捷键说明

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