AppMain.java
上传用户:whbcdz
上传日期:2008-08-04
资源大小:7683k
文件大小:2k
源码类别:

JavaScript

开发平台:

Java

  1. package appjxc;
  2. import java.awt.Toolkit;
  3. import javax.swing.SwingUtilities;
  4. import javax.swing.UIManager;
  5. import java.awt.Dimension;
  6. import appjxc.view.JF_main;
  7. import appjxc.dao.AdapterDao;
  8. public class AppMain {
  9.     boolean packFrame = false;
  10.     /**
  11.      * Construct and show the application.
  12.      */
  13.     public AppMain() {
  14.         JF_main frame = new JF_main();
  15.         // Validate frames that have preset sizes
  16.         // Pack frames that have useful preferred size info, e.g. from their layout
  17.         if (packFrame) {
  18.             frame.pack();
  19.         } else {
  20.             frame.validate();
  21.         }
  22.         // Center the window
  23.         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  24.         Dimension frameSize = frame.getSize();
  25.         if (frameSize.height > screenSize.height) {
  26.             frameSize.height = screenSize.height;
  27.         }
  28.         if (frameSize.width > screenSize.width) {
  29.             frameSize.width = screenSize.width;
  30.         }
  31.         frame.setLocation((screenSize.width - frameSize.width) / 2,
  32.                           (screenSize.height - frameSize.height) / 2);
  33.         frame.setVisible(true);
  34.     }
  35.     /**
  36.      * Application entry point.
  37.      *
  38.      * @param args String[]
  39.      */
  40.     /*public static void main(String[] args) {
  41.         SwingUtilities.invokeLater(new Runnable() {
  42.             public void run() {
  43.                 try {
  44.                     //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  45.                    // new AdapterDao();
  46.                     //Sleep(10000);
  47.                     UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
  48.                   //  SwingUtilities.updateComponentTreeUI(null);
  49.                 } catch (Exception exception) {
  50.                     exception.printStackTrace();
  51.                 }
  52.             }
  53.         });
  54.         //new AppMain();
  55.         new appjxc.view.JF_Login();
  56.     }*/
  57. }