KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nqadmin > swingSet > formatting > helpers > SelectorTest


1 /* $Id: SelectorTest.java,v 1.5 2005/02/04 22:42:15 yoda2 Exp $
2  *
3  * Tab Spacing = 4
4  *
5  * Copyright (c) 2004-2005, The Pangburn Company, Prasanth R. Pasala and
6  * Diego Gil
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * Redistributions of source code must retain the above copyright notice, this
13  * list of conditions and the following disclaimer. Redistributions in binary
14  * form must reproduce the above copyright notice, this list of conditions and
15  * the following disclaimer in the documentation and/or other materials
16  * provided with the distribution. The names of its contributors may not be
17  * used to endorse or promote products derived from this software without
18  * specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  */

33
34 package com.nqadmin.swingSet.formatting.helpers;
35
36 /**
37  *
38  * @author dags
39  */

40 public class SelectorTest extends javax.swing.JFrame JavaDoc {
41     
42     /** Creates new form SelectorTest */
43     public SelectorTest() {
44         initComponents();
45     }
46     
47     /** This method is called from within the constructor to
48      * initialize the form.
49      * WARNING: Do NOT modify this code. The content of this method is
50      * always regenerated by the Form Editor.
51      */

52     private void initComponents() {//GEN-BEGIN:initComponents
53
sSConnection1 = new com.nqadmin.swingSet.datasources.SSConnection();
54         helperPopup1 = new com.nqadmin.swingSet.formatting.helpers.HelperPopup();
55         helperPopup2 = new com.nqadmin.swingSet.formatting.helpers.HelperPopup();
56         helperPopup3 = new com.nqadmin.swingSet.formatting.helpers.HelperPopup();
57         jPanel1 = new javax.swing.JPanel JavaDoc();
58         sSFormattedTextField1 = new com.nqadmin.swingSet.formatting.SSFormattedTextField();
59         sSFormattedTextField2 = new com.nqadmin.swingSet.formatting.SSFormattedTextField();
60         sSFormattedTextField3 = new com.nqadmin.swingSet.formatting.SSFormattedTextField();
61
62         sSConnection1.setDriverName("org.postgresql.Driver");
63         sSConnection1.setUrl("jdbc:postgresql://localhost/mag");
64         sSConnection1.setUsername("dags");
65         try {
66             sSConnection1.createConnection();
67         }
68         catch(java.lang.ClassNotFoundException JavaDoc nf){
69
70         }
71         catch (java.lang.Exception JavaDoc exe) {
72
73         }
74         helperPopup1.setDataColumn("publication_id");
75         helperPopup1.setListColumn("publication_title");
76         helperPopup1.setOrderBy("publication_title");
77         helperPopup1.setTable("publications");
78         helperPopup1.setTarget(null);
79         helperPopup1.setConnection(sSConnection1);
80
81         helperPopup2.setDataColumn("party_id");
82         helperPopup2.setListColumn("party_name");
83         helperPopup2.setOrderBy("party_name");
84         helperPopup2.setTable("parties");
85         helperPopup2.setConnection(sSConnection1);
86
87         helperPopup3.setConnection(sSConnection1);
88         helperPopup3.setDataColumn("account_id");
89         helperPopup3.setListColumn("account_name");
90         helperPopup3.setOrderBy("account_name");
91         helperPopup3.setTable("accounts");
92
93         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
94         setTitle("SwingSet tests");
95         jPanel1.setLayout(new java.awt.BorderLayout JavaDoc());
96
97         sSFormattedTextField1.setColumns(30);
98         sSFormattedTextField1.setHelper(helperPopup1);
99         sSFormattedTextField1.setValue(new Integer JavaDoc(85));
100         jPanel1.add(sSFormattedTextField1, java.awt.BorderLayout.CENTER);
101
102         sSFormattedTextField2.setColumns(30);
103         sSFormattedTextField2.setHelper(helperPopup2);
104         sSFormattedTextField2.setValue(new Integer JavaDoc(1016));
105         jPanel1.add(sSFormattedTextField2, java.awt.BorderLayout.NORTH);
106
107         sSFormattedTextField3.setHelper(helperPopup3);
108         sSFormattedTextField3.setValue(new Integer JavaDoc(119));
109         jPanel1.add(sSFormattedTextField3, java.awt.BorderLayout.SOUTH);
110
111         getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
112
113         pack();
114     }//GEN-END:initComponents
115

116     /**
117      * @param args the command line arguments
118      */

119     public static void main(String JavaDoc args[]) {
120         java.awt.EventQueue.invokeLater(new Runnable JavaDoc() {
121             public void run() {
122                 new SelectorTest().setVisible(true);
123             }
124         });
125     }
126     
127     // Variables declaration - do not modify//GEN-BEGIN:variables
128
com.nqadmin.swingSet.formatting.helpers.HelperPopup helperPopup1;
129     com.nqadmin.swingSet.formatting.helpers.HelperPopup helperPopup2;
130     com.nqadmin.swingSet.formatting.helpers.HelperPopup helperPopup3;
131     javax.swing.JPanel JavaDoc jPanel1;
132     com.nqadmin.swingSet.datasources.SSConnection sSConnection1;
133     com.nqadmin.swingSet.formatting.SSFormattedTextField sSFormattedTextField1;
134     com.nqadmin.swingSet.formatting.SSFormattedTextField sSFormattedTextField2;
135     com.nqadmin.swingSet.formatting.SSFormattedTextField sSFormattedTextField3;
136     // End of variables declaration//GEN-END:variables
137

138 }
139
Popular Tags