回 帖 发 新 帖 刷新版面

主题:跪求java程序每行解释及功能实现

package test;

import java.awt.Toolkit;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Dimension;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Application1 {
    boolean packFrame = false;

    /**
     * Construct and show the application.
     */
    public Application1() {
        TicketFrame frame = new TicketFrame();
        // 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);
    }

    /**
     * Application entry point.
     *
     * @param args String[]
     */
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                try {
                    UIManager.setLookAndFeel(UIManager.
                                             getSystemLookAndFeelClassName());
                } catch (Exception exception) {
                    exception.printStackTrace();
                }

                new Application1();
            }
        });
    }
}

回复列表 (共1个回复)

沙发

[java私塾][JAVA基础入门视频][全套F+网盘]
http://www.ibeifeng.com/read-htm-tid-12375.html&u=86405
《Java无难事 孙鑫的Java视频教程RMVB版全 cd9修正版》[ISO](超大完整版)
http://www.ibeifeng.com/read-htm-tid-1135-fpage-2.html&u=86405

我来回复

您尚未登录,请登录后再回复。点此登录或注册