Application1.java
资源名称:jsp.rar [点击查看]
上传用户:kingwang
上传日期:2022-08-09
资源大小:1562k
文件大小:1k
源码类别:
百货/超市行业
开发平台:
JavaScript
- package uml_gaokai;
- import javax.swing.UIManager;
- import java.awt.*;
- /**
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
- * @author unascribed
- * @version 1.0
- */
- public class Application1 {
- private boolean packFrame = false;
- //Construct the application
- public Application1() {
- Frame1 frame = new Frame1();
- //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
- public static void main(String[] args) {
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- new Application1();
- }
- }