Yurttas/PL/DBL/mssql/F/04/02/00/JDBCScriptRunner00.java

 1/**
 2 *  Copyright(C) 2003
 3 *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4 *
 5 *  Permission to use, copy, modify, and distribute this
 6 *  software and its documentation for EDUCATIONAL purposes
 7 *  and without fee is hereby granted provided that this
 8 *  copyright notice appears in all copies.
 9 *
10 *  @date   : June 1, 2003.
11 *  @authorĀ : Salih Yurttas, Brian Autry.
12 */
13
14
15import javax.swing.UIManager;
16import java.awt.*;
17
18public class JDBCScriptRunner00 {
19
20  boolean packFrame = false;
21
22  public JDBCScriptRunner00() {
23    JDBCScriptRunnerUI frame = new JDBCScriptRunnerUI();
24
25    if(packFrame)
26      frame.pack();
27    else
28      frame.validate();
29
30    //Center the window
31    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
32    Dimension frameSize = frame.getSize();
33
34    if(frameSize.height>screenSize.height)
35      frameSize.height = screenSize.height;
36
37    if(frameSize.width>screenSize.width)
38      frameSize.width = screenSize.width;
39
40    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
41    frame.setVisible(true);
42  }
43
44  public static void main(String[] args) {
45    try {
46      UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
47    }
48    catch(Exception e) {
49      e.printStackTrace();
50    }
51    new JDBCScriptRunner00();
52  }
53
54}