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

From ZCubes Wiki
Jump to navigation Jump to search
 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.*;
16import java.awt.*;
17import java.awt.event.*;
18
19public class JDBCScriptRunnerUI extends JFrame {
20
21  private static JDBCScriptRunnerInputPanel ip;
22
23  //Construct the frame
24  public JDBCScriptRunnerUI() {
25    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
26    try {
27      jbInit();
28    }
29    catch(Exception e) {
30      e.printStackTrace();
31    }
32  }
33
34  //Component initialization
35  private void jbInit()
36    throws Exception
37  {
38    BorderLayout bL = new BorderLayout();
39    getContentPane().setLayout(bL);
40    ip = new JDBCScriptRunnerInputPanel();
41    getContentPane().add(ip, bL.CENTER);
42    this.setSize(512,432);
43    this.setTitle("JDBC Script Runner");
44  }
45
46  //Overridden so we can exit when window is closed
47  protected void processWindowEvent(WindowEvent e) {
48    super.processWindowEvent(e);
49    if(e.getID()==WindowEvent.WINDOW_CLOSING)
50      System.exit(0);
51  }
52
53}