<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.zcubes.com/index.php?action=history&amp;feed=atom&amp;title=Yurttas%2FPL%2FDBL%2Fpostgres%2FF%2F02%2F02%2F01%2FRunScriptUI.java</id>
	<title>Yurttas/PL/DBL/postgres/F/02/02/01/RunScriptUI.java - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.zcubes.com/index.php?action=history&amp;feed=atom&amp;title=Yurttas%2FPL%2FDBL%2Fpostgres%2FF%2F02%2F02%2F01%2FRunScriptUI.java"/>
	<link rel="alternate" type="text/html" href="http://wiki.zcubes.com/index.php?title=Yurttas/PL/DBL/postgres/F/02/02/01/RunScriptUI.java&amp;action=history"/>
	<updated>2026-06-08T08:14:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>http://wiki.zcubes.com/index.php?title=Yurttas/PL/DBL/postgres/F/02/02/01/RunScriptUI.java&amp;diff=83770&amp;oldid=prev</id>
		<title>MassBot1: Created page with &quot;&lt;syntaxhighlight lang=&quot;java&quot; line start=&quot;1&quot; enclose=&quot;div&quot;&gt;/**  *  Copyright(C) 1998  *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..  *  *  P...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.zcubes.com/index.php?title=Yurttas/PL/DBL/postgres/F/02/02/01/RunScriptUI.java&amp;diff=83770&amp;oldid=prev"/>
		<updated>2013-11-05T06:13:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/**  *  Copyright(C) 1998  *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..  *  *  P...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/**&lt;br /&gt;
 *  Copyright(C) 1998&lt;br /&gt;
 *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..&lt;br /&gt;
 *&lt;br /&gt;
 *  Permission to use, copy, modify, and distribute this&lt;br /&gt;
 *  software and its documentation for EDUCATIONAL purposes&lt;br /&gt;
 *  and without fee is hereby granted provided that this&lt;br /&gt;
 *  copyright notice appears in all copies.&lt;br /&gt;
 *&lt;br /&gt;
 *  Adapted by David Nolden, April 19, 2003&lt;br /&gt;
 *&lt;br /&gt;
 *  @date   : January 1, 1998.&lt;br /&gt;
 *  @author : Salih Yurttas.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import ui.*;&lt;br /&gt;
import inout.*;&lt;br /&gt;
import sqls.*;&lt;br /&gt;
import javax.swing.*;&lt;br /&gt;
import java.awt.*;&lt;br /&gt;
import java.awt.event.*;&lt;br /&gt;
import java.sql.Connection;&lt;br /&gt;
&lt;br /&gt;
public class RunScriptUI extends Frame&lt;br /&gt;
                         implements ActionListener {&lt;br /&gt;
&lt;br /&gt;
  private String[] menuLabel = {&amp;quot;Create&amp;quot;,&lt;br /&gt;
                                &amp;quot;Delete&amp;quot;,&lt;br /&gt;
                                &amp;quot;Query&amp;quot;};&lt;br /&gt;
  private int mLabelLength= menuLabel.length;&lt;br /&gt;
  private Connection mycon;&lt;br /&gt;
  private MenuBar mB;&lt;br /&gt;
  private Menu[] m;&lt;br /&gt;
  private DBLogin dbLogin;&lt;br /&gt;
&lt;br /&gt;
  private UIRunScript[] uIRunScript = {new UIRunScript(new SQLScript(&amp;quot;Create Tables&amp;quot;)),&lt;br /&gt;
                                       new UIRunScript(new SQLScript(&amp;quot;Insert Tuples&amp;quot;)),&lt;br /&gt;
                                       new UIRunScript(new SQLScript(&amp;quot;Drop Tables&amp;quot;)),&lt;br /&gt;
                                       new UIRunScript(new SQLScript(&amp;quot;Delete Tuples&amp;quot;)),&lt;br /&gt;
                                       new UIRunScript(new SQLScript(&amp;quot;Query Database&amp;quot;))};&lt;br /&gt;
&lt;br /&gt;
  public RunScriptUI() {&lt;br /&gt;
    super(&amp;quot;RunScriptUI&amp;quot;);&lt;br /&gt;
    dbLogin = new DBLogin(this);&lt;br /&gt;
    dbLogin.pack();&lt;br /&gt;
    dbLogin.setLocationRelativeTo(this);&lt;br /&gt;
    dbLogin.setVisible(true);&lt;br /&gt;
    if (dbLogin.fail)&lt;br /&gt;
      System.exit(0);&lt;br /&gt;
    mycon = dbLogin.getCon();&lt;br /&gt;
    try {&lt;br /&gt;
      mB = new MenuBar();&lt;br /&gt;
&lt;br /&gt;
      m = new Menu[mLabelLength];&lt;br /&gt;
&lt;br /&gt;
      for(int i=0; i&amp;lt;mLabelLength; i++) {&lt;br /&gt;
        m[i] = new Menu(menuLabel[i]);&lt;br /&gt;
&lt;br /&gt;
        switch(i) {&lt;br /&gt;
          case 0 : for(int j=0; j&amp;lt;2; j++)&lt;br /&gt;
                     uIRunScript[j].addSelfToMenu(m[i]);&lt;br /&gt;
                   break;&lt;br /&gt;
          case 1 : for(int j=2; j&amp;lt;4; j++)&lt;br /&gt;
                     uIRunScript[j].addSelfToMenu(m[i]);&lt;br /&gt;
                   break;&lt;br /&gt;
          case 2 : for(int j=4; j&amp;lt;5; j++)&lt;br /&gt;
                     uIRunScript[j].addSelfToMenu(m[i]);&lt;br /&gt;
                   break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        m[i].addActionListener(this);&lt;br /&gt;
        mB.add(m[i]);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      setMenuBar(mB);&lt;br /&gt;
&lt;br /&gt;
      addWindowListener(&lt;br /&gt;
        new WindowAdapter() {&lt;br /&gt;
          public void windowClosing(WindowEvent wE) {&lt;br /&gt;
            System.exit(0);&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      );&lt;br /&gt;
    }&lt;br /&gt;
    catch(Exception e) {&lt;br /&gt;
      System.out.println(e);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public void actionPerformed(ActionEvent aE) {&lt;br /&gt;
    String arg = aE.getActionCommand();&lt;br /&gt;
    for(int i=0; i&amp;lt;2; i++)&lt;br /&gt;
      if(uIRunScript[i].nameEquals(arg))&lt;br /&gt;
        uIRunScript[i].runScript(this, mycon);&lt;br /&gt;
&lt;br /&gt;
    for(int i=2; i&amp;lt;4; i++)&lt;br /&gt;
      if(uIRunScript[i].nameEquals(arg))&lt;br /&gt;
         uIRunScript[i].runScript(this, mycon);&lt;br /&gt;
&lt;br /&gt;
    for(int i=4; i&amp;lt;5; i++)&lt;br /&gt;
      if(uIRunScript[i].nameEquals(arg))&lt;br /&gt;
         uIRunScript[i].runScript(this, mycon);&lt;br /&gt;
&lt;br /&gt;
    repaint();&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  static public void main(String[] args) {&lt;br /&gt;
    RunScriptUI rSUI = new RunScriptUI();&lt;br /&gt;
    rSUI.setLocationRelativeTo(null);&lt;br /&gt;
    rSUI.setSize(320, 160);&lt;br /&gt;
    rSUI.show();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>MassBot1</name></author>
	</entry>
</feed>