📄 wbmpeditor.java
字号:
package wbmp;import javax.swing.UIManager;import java.awt.*;/** * Description: A simple black and white graphics editor for creating simple * WAP graphics. This project will be included in the WAP IDE project * but can run alone. * Copyright (c) 2003 * @author Mark Busman * @version 1.0 * Contact info: cougar@skyinet.net * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */public class WBMPEditor { boolean packFrame = false; /**Construct the application*/ public WBMPEditor() { WBMPEditorFrame frame = new WBMPEditorFrame(); //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); } /**Main method @param String[] Commandline Arguments */ public static void main(String[] args) { String message = "WBMP Editor version 1.0, Copyright (C) 2003 Mark Busman\n"; message = message + "WBMP Editor comes with ABSOLUTELY NO WARRANTY;\nfor details see Copying.txt\n"; message = message + "This is free software, and you are welcome to redistribute it under certain conditions; see Copying.txt for the details."; System.out.println(message); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { e.printStackTrace(); } new WBMPEditor(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -