1 33 34 package com.nqadmin.swingSet.formatting.helpers; 35 36 40 public class SelectorTest extends javax.swing.JFrame { 41 42 43 public SelectorTest() { 44 initComponents(); 45 } 46 47 52 private void initComponents() { 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 (); 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 nf){ 69 70 } 71 catch (java.lang.Exception 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 ()); 96 97 sSFormattedTextField1.setColumns(30); 98 sSFormattedTextField1.setHelper(helperPopup1); 99 sSFormattedTextField1.setValue(new Integer (85)); 100 jPanel1.add(sSFormattedTextField1, java.awt.BorderLayout.CENTER); 101 102 sSFormattedTextField2.setColumns(30); 103 sSFormattedTextField2.setHelper(helperPopup2); 104 sSFormattedTextField2.setValue(new Integer (1016)); 105 jPanel1.add(sSFormattedTextField2, java.awt.BorderLayout.NORTH); 106 107 sSFormattedTextField3.setHelper(helperPopup3); 108 sSFormattedTextField3.setValue(new Integer (119)); 109 jPanel1.add(sSFormattedTextField3, java.awt.BorderLayout.SOUTH); 110 111 getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); 112 113 pack(); 114 } 116 119 public static void main(String args[]) { 120 java.awt.EventQueue.invokeLater(new Runnable () { 121 public void run() { 122 new SelectorTest().setVisible(true); 123 } 124 }); 125 } 126 127 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 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 138 } 139 | Popular Tags |