Скачиваний:
24
Добавлен:
01.05.2014
Размер:
1.89 Кб
Скачать

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class Application1 {
    boolean packFrame = false;

    /**
     * Construct and show the application.
     */
    public Application1() {
        MainFrame frame = new MainFrame();
        // 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);
        try {
            jbInit();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    /**
     * 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();
            }
        });
    }

    private void jbInit() throws Exception {
    }
}
Соседние файлы в папке Лабораторная работа 31
  • #
    01.05.2014671 б22Application1$1.class
  • #
    01.05.20141.19 Кб23Application1.class
  • #
    01.05.20141.89 Кб24Application1.java
  • #
    01.05.201459 б22Compile.bat
  • #
    01.05.2014293.38 Кб34Lab3.doc
  • #
    01.05.20146.65 Кб23MainFrame.class
  • #
    01.05.20149.02 Кб23MainFrame.java
  • #
    01.05.2014455 б22MainFrame_decryptButton_mouseAdapter.class