├── nbproject
├── private
│ ├── config.properties
│ ├── private.properties
│ └── private.xml
├── genfiles.properties
├── project.xml
└── project.properties
├── t.jpg
├── src
├── t.jpg
├── child
│ ├── t.jpg
│ ├── SelectChildData.java
│ └── SelectChildData.form
├── orphange
│ ├── t.jpg
│ └── Orphange.java
├── Data.java
├── Update.form
├── ShowData.form
├── Update.java
├── SelectStaff.form
├── SignUpPage.form
├── SelectStaff.java
├── ChildDetails.form
├── ShowData.java
├── LinkForm.form
├── ParentForm.form
├── ParentForm.java
├── LoginForm.form
├── LinkForm.java
├── LoginForm.java
├── SignUpPage.java
├── DonationForm.form
├── ChildDetails.java
├── StaffForm.form
├── DonationForm.java
├── ChildForm.form
└── ChildForm.java
├── test
└── t.jpg
├── manifest.mf
└── README.md
/nbproject/private/config.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/t.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jishanshaikh4/management-platform/HEAD/t.jpg
--------------------------------------------------------------------------------
/src/t.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jishanshaikh4/management-platform/HEAD/src/t.jpg
--------------------------------------------------------------------------------
/test/t.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jishanshaikh4/management-platform/HEAD/test/t.jpg
--------------------------------------------------------------------------------
/src/child/t.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jishanshaikh4/management-platform/HEAD/src/child/t.jpg
--------------------------------------------------------------------------------
/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/src/orphange/t.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jishanshaikh4/management-platform/HEAD/src/orphange/t.jpg
--------------------------------------------------------------------------------
/nbproject/private/private.properties:
--------------------------------------------------------------------------------
1 | compile.on.save=true
2 | do.depend=false
3 | do.jar=true
4 | javac.debug=true
5 | javadoc.preview=true
6 | user.properties.file=C:\\Users\\Muska\\AppData\\Roaming\\NetBeans\\8.1\\build.properties
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Management Platform
2 |
3 | [](https://www.codefactor.io/repository/github/jishanshaikh4/management-platform/issues/main)
4 |
5 | Data management and accessibility platform (e.g. an orphanage) based on Java.
6 |
--------------------------------------------------------------------------------
/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=179840ab
2 | build.xml.script.CRC32=7295fd03
3 | build.xml.stylesheet.CRC32=8064a381@1.79.1.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=179840ab
7 | nbproject/build-impl.xml.script.CRC32=70070750
8 | nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
9 |
--------------------------------------------------------------------------------
/src/orphange/Orphange.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package orphange;
7 |
8 | /**
9 | *
10 | * @author tanu
11 | */
12 | public class Orphange {
13 |
14 | /**
15 | * @param args the command line arguments
16 | */
17 | public static void main(String[] args) {
18 | // TODO code application logic here
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | orphange
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/nbproject/private/private.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | file:/C:/Users/Muska/OneDrive/Documents/NetBeansProjects/orphange/src/LoginForm.java
7 | file:/C:/Users/Muska/OneDrive/Documents/NetBeansProjects/orphange/src/DonationForm.java
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Data.java:
--------------------------------------------------------------------------------
1 |
2 | import java.sql.Connection;
3 | import java.sql.DriverManager;
4 |
5 | /*
6 | * To change this license header, choose License Headers in Project Properties.
7 | * To change this template file, choose Tools | Templates
8 | * and open the template in the editor.
9 | */
10 |
11 | /**
12 | *
13 | * @author tanu
14 | */
15 | public class Data {
16 |
17 | public static Connection connect()
18 | {
19 | Connection con=null;
20 | try{
21 |
22 |
23 | Class.forName("com.mysql.jdbc.Driver");
24 | con=DriverManager.getConnection("jdbc:mysql://localhost:3306/data5","root","root");
25 | }
26 | catch(Exception e)
27 | {
28 | System.out.println(e);
29 |
30 | }
31 | return con;
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=false
3 | annotation.processing.processors.list=
4 | annotation.processing.run.all.processors=true
5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
6 | application.title=orphange
7 | application.vendor=tanu
8 | build.classes.dir=${build.dir}/classes
9 | build.classes.excludes=**/*.java,**/*.form
10 | # This directory is removed when the project is cleaned:
11 | build.dir=build
12 | build.generated.dir=${build.dir}/generated
13 | build.generated.sources.dir=${build.dir}/generated-sources
14 | # Only compile against the classpath explicitly listed here:
15 | build.sysclasspath=ignore
16 | build.test.classes.dir=${build.dir}/test/classes
17 | build.test.results.dir=${build.dir}/test/results
18 | # Uncomment to specify the preferred debugger connection transport:
19 | #debug.transport=dt_socket
20 | debug.classpath=\
21 | ${run.classpath}
22 | debug.test.classpath=\
23 | ${run.test.classpath}
24 | # Files in build.classes.dir which should be excluded from distribution jar
25 | dist.archive.excludes=
26 | # This directory is removed when the project is cleaned:
27 | dist.dir=dist
28 | dist.jar=${dist.dir}/orphange.jar
29 | dist.javadoc.dir=${dist.dir}/javadoc
30 | endorsed.classpath=
31 | excludes=
32 | includes=**
33 | jar.compress=false
34 | javac.classpath=\
35 | ${libs.MySQLDriver.classpath}:\
36 | ${libs.absolutelayout.classpath}
37 | # Space-separated list of extra javac options
38 | javac.compilerargs=
39 | javac.deprecation=false
40 | javac.external.vm=true
41 | javac.processorpath=\
42 | ${javac.classpath}
43 | javac.source=1.8
44 | javac.target=1.8
45 | javac.test.classpath=\
46 | ${javac.classpath}:\
47 | ${build.classes.dir}
48 | javac.test.processorpath=\
49 | ${javac.test.classpath}
50 | javadoc.additionalparam=
51 | javadoc.author=false
52 | javadoc.encoding=${source.encoding}
53 | javadoc.noindex=false
54 | javadoc.nonavbar=false
55 | javadoc.notree=false
56 | javadoc.private=false
57 | javadoc.splitindex=true
58 | javadoc.use=true
59 | javadoc.version=false
60 | javadoc.windowtitle=
61 | main.class=orphange.Orphange
62 | manifest.file=manifest.mf
63 | meta.inf.dir=${src.dir}/META-INF
64 | mkdist.disabled=false
65 | platform.active=default_platform
66 | run.classpath=\
67 | ${javac.classpath}:\
68 | ${build.classes.dir}
69 | # Space-separated list of JVM arguments used when running the project.
70 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
71 | # To set system properties for unit tests define test-sys-prop.name=value:
72 | run.jvmargs=
73 | run.test.classpath=\
74 | ${javac.test.classpath}:\
75 | ${build.test.classes.dir}
76 | source.encoding=UTF-8
77 | src.dir=src
78 | test.src.dir=test
79 |
--------------------------------------------------------------------------------
/src/Update.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
64 |
--------------------------------------------------------------------------------
/src/ShowData.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
86 |
--------------------------------------------------------------------------------
/src/child/SelectChildData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 | /**
8 | *
9 | * @author tanu
10 | */
11 | package child;
12 | public class SelectChildData extends javax.swing.JFrame {
13 |
14 | /**
15 | * Creates new form SelectChildData
16 | */
17 | public SelectChildData() {
18 | initComponents();
19 |
20 | }
21 |
22 | /**
23 | * This method is called from within the constructor to initialize the form.
24 | * WARNING: Do NOT modify this code. The content of this method is always
25 | * regenerated by the Form Editor.
26 | */
27 | @SuppressWarnings("unchecked")
28 | // //GEN-BEGIN:initComponents
29 | private void initComponents() {
30 |
31 | jScrollPane1 = new javax.swing.JScrollPane();
32 | Table1 = new javax.swing.JTable();
33 |
34 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
35 |
36 | Table1.setModel(new javax.swing.table.DefaultTableModel(
37 | new Object [][] {
38 | {null, null, null, null, null, null, null},
39 | {null, null, null, null, null, null, null},
40 | {null, null, null, null, null, null, null}
41 | },
42 | new String [] {
43 | "Child Id", "Child Name", "age", "class", "bloodG", "HealthIss", "image"
44 | }
45 | ));
46 | jScrollPane1.setViewportView(Table1);
47 |
48 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
49 | getContentPane().setLayout(layout);
50 | layout.setHorizontalGroup(
51 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
52 | .addGroup(layout.createSequentialGroup()
53 | .addContainerGap()
54 | .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 420, Short.MAX_VALUE)
55 | .addContainerGap())
56 | );
57 | layout.setVerticalGroup(
58 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
59 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
60 | .addContainerGap(14, Short.MAX_VALUE)
61 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
62 | .addGap(92, 92, 92))
63 | );
64 |
65 | pack();
66 | }// //GEN-END:initComponents
67 |
68 | /**
69 | * @param args the command line arguments
70 | */
71 | public static void main(String args[]) {
72 | /* Set the Nimbus look and feel */
73 | //
74 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
75 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
76 | */
77 | try {
78 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
79 | if ("Nimbus".equals(info.getName())) {
80 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
81 | break;
82 | }
83 | }
84 | } catch (ClassNotFoundException ex) {
85 | java.util.logging.Logger.getLogger(SelectChildData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
86 | } catch (InstantiationException ex) {
87 | java.util.logging.Logger.getLogger(SelectChildData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
88 | } catch (IllegalAccessException ex) {
89 | java.util.logging.Logger.getLogger(SelectChildData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
90 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
91 | java.util.logging.Logger.getLogger(SelectChildData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
92 | }
93 | //
94 |
95 | /* Create and display the form */
96 | java.awt.EventQueue.invokeLater(new Runnable() {
97 | public void run() {
98 | new SelectChildData().setVisible(true);
99 | }
100 | });
101 | }
102 |
103 | // Variables declaration - do not modify//GEN-BEGIN:variables
104 | private javax.swing.JTable Table1;
105 | private javax.swing.JScrollPane jScrollPane1;
106 | // End of variables declaration//GEN-END:variables
107 | }
108 |
--------------------------------------------------------------------------------
/src/Update.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 | /**
8 | *
9 | * @author tanu
10 | */
11 | public class Update extends javax.swing.JFrame {
12 |
13 | /**
14 | * Creates new form Update
15 | */
16 | public Update() {
17 | initComponents();
18 | }
19 |
20 | /**
21 | * This method is called from within the constructor to initialize the form.
22 | * WARNING: Do NOT modify this code. The content of this method is always
23 | * regenerated by the Form Editor.
24 | */
25 | @SuppressWarnings("unchecked")
26 | // //GEN-BEGIN:initComponents
27 | private void initComponents() {
28 |
29 | jButton1 = new javax.swing.JButton();
30 | jButton2 = new javax.swing.JButton();
31 |
32 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
33 |
34 | jButton1.setText("Update Child Details");
35 |
36 | jButton2.setText("Update Staff Details");
37 | jButton2.addActionListener(new java.awt.event.ActionListener() {
38 | public void actionPerformed(java.awt.event.ActionEvent evt) {
39 | jButton2ActionPerformed(evt);
40 | }
41 | });
42 |
43 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
44 | getContentPane().setLayout(layout);
45 | layout.setHorizontalGroup(
46 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
47 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
48 | .addContainerGap(118, Short.MAX_VALUE)
49 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
50 | .addComponent(jButton2)
51 | .addComponent(jButton1))
52 | .addGap(153, 153, 153))
53 | );
54 | layout.setVerticalGroup(
55 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
56 | .addGroup(layout.createSequentialGroup()
57 | .addGap(82, 82, 82)
58 | .addComponent(jButton1)
59 | .addGap(32, 32, 32)
60 | .addComponent(jButton2)
61 | .addContainerGap(140, Short.MAX_VALUE))
62 | );
63 |
64 | pack();
65 | }// //GEN-END:initComponents
66 |
67 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
68 | // TODO add your handling code here:
69 | }//GEN-LAST:event_jButton2ActionPerformed
70 |
71 | /**
72 | * @param args the command line arguments
73 | */
74 | public static void main(String args[]) {
75 | /* Set the Nimbus look and feel */
76 | //
77 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
78 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
79 | */
80 | try {
81 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
82 | if ("Nimbus".equals(info.getName())) {
83 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
84 | break;
85 | }
86 | }
87 | } catch (ClassNotFoundException ex) {
88 | java.util.logging.Logger.getLogger(Update.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
89 | } catch (InstantiationException ex) {
90 | java.util.logging.Logger.getLogger(Update.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
91 | } catch (IllegalAccessException ex) {
92 | java.util.logging.Logger.getLogger(Update.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
93 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
94 | java.util.logging.Logger.getLogger(Update.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
95 | }
96 | //
97 |
98 | /* Create and display the form */
99 | java.awt.EventQueue.invokeLater(new Runnable() {
100 | public void run() {
101 | new Update().setVisible(true);
102 | }
103 | });
104 | }
105 |
106 | // Variables declaration - do not modify//GEN-BEGIN:variables
107 | private javax.swing.JButton jButton1;
108 | private javax.swing.JButton jButton2;
109 | // End of variables declaration//GEN-END:variables
110 | }
111 |
--------------------------------------------------------------------------------
/src/SelectStaff.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
110 |
--------------------------------------------------------------------------------
/src/child/SelectChildData.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
112 |
--------------------------------------------------------------------------------
/src/SignUpPage.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
122 |
--------------------------------------------------------------------------------
/src/SelectStaff.java:
--------------------------------------------------------------------------------
1 |
2 | import java.sql.Connection;
3 | import java.sql.PreparedStatement;
4 | import java.sql.ResultSet;
5 | import java.sql.ResultSetMetaData;
6 | import java.sql.SQLException;
7 | import java.sql.Statement;
8 | import java.util.Vector;
9 | import java.util.logging.Level;
10 | import java.util.logging.Logger;
11 | import javax.swing.table.DefaultTableModel;
12 |
13 | /*
14 | * To change this license header, choose License Headers in Project Properties.
15 | * To change this template file, choose Tools | Templates
16 | * and open the template in the editor.
17 | */
18 |
19 | /**
20 | *
21 | * @author tanu
22 | */
23 | public class SelectStaff extends javax.swing.JFrame {
24 |
25 | /**
26 | * Creates new form SelectStaff
27 | */private Connection con;
28 | private PreparedStatement ps;
29 | public SelectStaff() {
30 | initComponents();
31 | con=Data.connect();
32 | SelectDatas();
33 | }
34 | void SelectDatas()
35 | {
36 | String sql="select*from staff";
37 | Statement stm;
38 | try {
39 | stm = con.createStatement();
40 | String[] tableColumnsName={"Id","passoword","name","mobile","address","work","email"};
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | DefaultTableModel aModel=(DefaultTableModel)Table1.getModel();
49 | aModel.setColumnIdentifiers(tableColumnsName);
50 | ResultSet rs= stm.executeQuery(sql);
51 | ResultSetMetaData rsmd=rs.getMetaData();
52 | int colno=rsmd.getColumnCount();
53 | while(rs.next())
54 | {
55 | Object[] obj=new Object[colno];
56 | for(int i=0;i//GEN-BEGIN:initComponents
107 | private void initComponents() {
108 |
109 | jScrollPane1 = new javax.swing.JScrollPane();
110 | Table1 = new javax.swing.JTable();
111 |
112 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
113 |
114 | Table1.setModel(new javax.swing.table.DefaultTableModel(
115 | new Object [][] {
116 |
117 | },
118 | new String [] {
119 | "Id", "Password", "Name", "Mobile", "Address", "Work", "Email"
120 | }
121 | ));
122 | jScrollPane1.setViewportView(Table1);
123 |
124 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
125 | getContentPane().setLayout(layout);
126 | layout.setHorizontalGroup(
127 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
128 | .addGroup(layout.createSequentialGroup()
129 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
130 | .addGap(0, 25, Short.MAX_VALUE))
131 | );
132 | layout.setVerticalGroup(
133 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
134 | .addGroup(layout.createSequentialGroup()
135 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
136 | .addGap(0, 25, Short.MAX_VALUE))
137 | );
138 |
139 | pack();
140 | }// //GEN-END:initComponents
141 |
142 | /**
143 | * @param args the command line arguments
144 | */
145 | public static void main(String args[]) {
146 | /* Set the Nimbus look and feel */
147 | //
148 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
149 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
150 | */
151 | try {
152 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
153 | if ("Nimbus".equals(info.getName())) {
154 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
155 | break;
156 | }
157 | }
158 | } catch (ClassNotFoundException ex) {
159 | java.util.logging.Logger.getLogger(SelectStaff.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
160 | } catch (InstantiationException ex) {
161 | java.util.logging.Logger.getLogger(SelectStaff.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
162 | } catch (IllegalAccessException ex) {
163 | java.util.logging.Logger.getLogger(SelectStaff.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
164 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
165 | java.util.logging.Logger.getLogger(SelectStaff.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
166 | }
167 | //
168 |
169 | /* Create and display the form */
170 | java.awt.EventQueue.invokeLater(new Runnable() {
171 | public void run() {
172 | new SelectStaff().setVisible(true);
173 | }
174 | });
175 | }
176 |
177 | // Variables declaration - do not modify//GEN-BEGIN:variables
178 | private javax.swing.JTable Table1;
179 | private javax.swing.JScrollPane jScrollPane1;
180 | // End of variables declaration//GEN-END:variables
181 | }
182 |
--------------------------------------------------------------------------------
/src/ChildDetails.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
141 |
--------------------------------------------------------------------------------
/src/ShowData.java:
--------------------------------------------------------------------------------
1 |
2 | import child.*;
3 | import java.sql.Connection;
4 | import java.sql.PreparedStatement;
5 | import java.sql.ResultSet;
6 | import java.sql.SQLException;
7 | import java.sql.Statement;
8 | import java.util.ArrayList;
9 | import java.util.logging.Level;
10 | import java.util.logging.Logger;
11 | import javax.swing.table.DefaultTableModel;
12 |
13 | /*
14 | * To change this license header, choose License Headers in Project Properties.
15 | * To change this template file, choose Tools | Templates
16 | * and open the template in the editor.
17 | */
18 |
19 | /**
20 | *
21 | * @author tanu
22 | */
23 | public class ShowData extends javax.swing.JFrame {
24 |
25 | /**
26 | * Creates new form ShowData
27 | */
28 | private Connection con;
29 | private PreparedStatement ps;
30 | public ShowData() {
31 | initComponents();
32 |
33 | con=Data.connect();
34 |
35 |
36 | }
37 |
38 |
39 | /**
40 | * This method is called from within the constructor to initialize the form.
41 | * WARNING: Do NOT modify this code. The content of this method is always
42 | * regenerated by the Form Editor.
43 | */
44 | @SuppressWarnings("unchecked")
45 | // //GEN-BEGIN:initComponents
46 | private void initComponents() {
47 |
48 | jButton1 = new javax.swing.JButton();
49 | jButton2 = new javax.swing.JButton();
50 | jButton3 = new javax.swing.JButton();
51 | jButton4 = new javax.swing.JButton();
52 |
53 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
54 |
55 | jButton1.setText("For Child Details");
56 | jButton1.addActionListener(new java.awt.event.ActionListener() {
57 | public void actionPerformed(java.awt.event.ActionEvent evt) {
58 | jButton1ActionPerformed(evt);
59 | }
60 | });
61 |
62 | jButton2.setText("For Staff Details");
63 | jButton2.addActionListener(new java.awt.event.ActionListener() {
64 | public void actionPerformed(java.awt.event.ActionEvent evt) {
65 | jButton2ActionPerformed(evt);
66 | }
67 | });
68 |
69 | jButton3.setText("For Parent Details");
70 |
71 | jButton4.setText("For Donation Details");
72 | jButton4.addActionListener(new java.awt.event.ActionListener() {
73 | public void actionPerformed(java.awt.event.ActionEvent evt) {
74 | jButton4ActionPerformed(evt);
75 | }
76 | });
77 |
78 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
79 | getContentPane().setLayout(layout);
80 | layout.setHorizontalGroup(
81 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
82 | .addGroup(layout.createSequentialGroup()
83 | .addGap(136, 136, 136)
84 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
85 | .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
86 | .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
87 | .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
88 | .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
89 | .addContainerGap(135, Short.MAX_VALUE))
90 | );
91 | layout.setVerticalGroup(
92 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
93 | .addGroup(layout.createSequentialGroup()
94 | .addGap(45, 45, 45)
95 | .addComponent(jButton1)
96 | .addGap(18, 18, 18)
97 | .addComponent(jButton2)
98 | .addGap(29, 29, 29)
99 | .addComponent(jButton3)
100 | .addGap(32, 32, 32)
101 | .addComponent(jButton4)
102 | .addContainerGap(84, Short.MAX_VALUE))
103 | );
104 |
105 | pack();
106 | }// //GEN-END:initComponents
107 |
108 | private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
109 | // TODO add your handling code here:
110 | }//GEN-LAST:event_jButton4ActionPerformed
111 |
112 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
113 |
114 |
115 |
116 |
117 |
118 | }//GEN-LAST:event_jButton2ActionPerformed
119 |
120 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
121 | // TODO add your handling code here:
122 | ChildDetails ch=new ChildDetails();
123 | ch.setVisible(true);
124 |
125 | }//GEN-LAST:event_jButton1ActionPerformed
126 |
127 | /**
128 | * @param args the command line arguments
129 | */
130 | public static void main(String args[]) {
131 | /* Set the Nimbus look and feel */
132 | //
133 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
134 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
135 | */
136 | try {
137 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
138 | if ("Nimbus".equals(info.getName())) {
139 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
140 | break;
141 | }
142 | }
143 | } catch (ClassNotFoundException ex) {
144 | java.util.logging.Logger.getLogger(ShowData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
145 | } catch (InstantiationException ex) {
146 | java.util.logging.Logger.getLogger(ShowData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
147 | } catch (IllegalAccessException ex) {
148 | java.util.logging.Logger.getLogger(ShowData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
149 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
150 | java.util.logging.Logger.getLogger(ShowData.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
151 | }
152 | //
153 |
154 | /* Create and display the form */
155 | java.awt.EventQueue.invokeLater(new Runnable() {
156 | public void run() {
157 | new ShowData().setVisible(true);
158 | }
159 | });
160 | }
161 |
162 | // Variables declaration - do not modify//GEN-BEGIN:variables
163 | private javax.swing.JButton jButton1;
164 | private javax.swing.JButton jButton2;
165 | private javax.swing.JButton jButton3;
166 | private javax.swing.JButton jButton4;
167 | // End of variables declaration//GEN-END:variables
168 | }
169 |
--------------------------------------------------------------------------------
/src/LinkForm.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
137 |
--------------------------------------------------------------------------------
/src/ParentForm.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
156 |
--------------------------------------------------------------------------------
/src/ParentForm.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 | /**
8 | *
9 | * @author tanu
10 | */
11 | public class ParentForm extends javax.swing.JFrame {
12 |
13 | /**
14 | * Creates new form ParentForm
15 | */
16 | public ParentForm() {
17 | initComponents();
18 | }
19 |
20 | /**
21 | * This method is called from within the constructor to initialize the form.
22 | * WARNING: Do NOT modify this code. The content of this method is always
23 | * regenerated by the Form Editor.
24 | */
25 | @SuppressWarnings("unchecked")
26 | // //GEN-BEGIN:initComponents
27 | private void initComponents() {
28 |
29 | jTextField1 = new javax.swing.JTextField();
30 | jTextField2 = new javax.swing.JTextField();
31 | t2 = new javax.swing.JTextField();
32 | t3 = new javax.swing.JTextField();
33 | t4 = new javax.swing.JTextField();
34 | t5 = new javax.swing.JTextField();
35 | jLabel1 = new javax.swing.JLabel();
36 | jLabel2 = new javax.swing.JLabel();
37 | jLabel3 = new javax.swing.JLabel();
38 | jLabel4 = new javax.swing.JLabel();
39 | jLabel5 = new javax.swing.JLabel();
40 | t1 = new javax.swing.JTextField();
41 | jButton1 = new javax.swing.JButton();
42 |
43 | jTextField1.setText("jTextField1");
44 |
45 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
46 |
47 | jTextField2.setText("t1");
48 |
49 | t2.addActionListener(new java.awt.event.ActionListener() {
50 | public void actionPerformed(java.awt.event.ActionEvent evt) {
51 | t2ActionPerformed(evt);
52 | }
53 | });
54 |
55 | jLabel1.setText("Parent Name");
56 |
57 | jLabel2.setText("Mobile No");
58 |
59 | jLabel3.setText("Email Id");
60 |
61 | jLabel4.setText("Address");
62 |
63 | jLabel5.setText("proffession");
64 |
65 | jButton1.setText("Submit");
66 |
67 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
68 | getContentPane().setLayout(layout);
69 | layout.setHorizontalGroup(
70 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
71 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
72 | .addGap(72, 72, 72)
73 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
74 | .addGroup(layout.createSequentialGroup()
75 | .addGap(0, 0, Short.MAX_VALUE)
76 | .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
77 | .addGap(6, 6, 6))
78 | .addGroup(layout.createSequentialGroup()
79 | .addGap(10, 10, 10)
80 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
81 | .addComponent(jLabel3)
82 | .addComponent(jLabel2)
83 | .addComponent(jLabel4)
84 | .addComponent(jLabel1)
85 | .addComponent(jLabel5))
86 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
87 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
88 | .addComponent(t2, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
89 | .addComponent(t3)
90 | .addComponent(t4)
91 | .addComponent(t5)
92 | .addComponent(t1))
93 | .addGap(40, 40, 40))
94 | .addGroup(layout.createSequentialGroup()
95 | .addGap(142, 142, 142)
96 | .addComponent(jButton1)
97 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
98 | );
99 | layout.setVerticalGroup(
100 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
101 | .addGroup(layout.createSequentialGroup()
102 | .addGap(35, 35, 35)
103 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
104 | .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
105 | .addComponent(jLabel1)
106 | .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
107 | .addGap(18, 18, 18)
108 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
109 | .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
110 | .addComponent(jLabel2))
111 | .addGap(18, 18, 18)
112 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
113 | .addComponent(jLabel3)
114 | .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
115 | .addGap(23, 23, 23)
116 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
117 | .addComponent(jLabel4)
118 | .addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
119 | .addGap(18, 18, 18)
120 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
121 | .addComponent(t5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
122 | .addComponent(jLabel5))
123 | .addGap(32, 32, 32)
124 | .addComponent(jButton1)
125 | .addContainerGap(33, Short.MAX_VALUE))
126 | );
127 |
128 | pack();
129 | }// //GEN-END:initComponents
130 |
131 | private void t2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_t2ActionPerformed
132 | // TODO add your handling code here:
133 | }//GEN-LAST:event_t2ActionPerformed
134 |
135 | /**
136 | * @param args the command line arguments
137 | */
138 | public static void main(String args[]) {
139 | /* Set the Nimbus look and feel */
140 | //
141 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
142 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
143 | */
144 | try {
145 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
146 | if ("Nimbus".equals(info.getName())) {
147 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
148 | break;
149 | }
150 | }
151 | } catch (ClassNotFoundException ex) {
152 | java.util.logging.Logger.getLogger(ParentForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
153 | } catch (InstantiationException ex) {
154 | java.util.logging.Logger.getLogger(ParentForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
155 | } catch (IllegalAccessException ex) {
156 | java.util.logging.Logger.getLogger(ParentForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
157 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
158 | java.util.logging.Logger.getLogger(ParentForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
159 | }
160 | //
161 |
162 | /* Create and display the form */
163 | java.awt.EventQueue.invokeLater(new Runnable() {
164 | public void run() {
165 | new ParentForm().setVisible(true);
166 | }
167 | });
168 | }
169 |
170 | // Variables declaration - do not modify//GEN-BEGIN:variables
171 | private javax.swing.JButton jButton1;
172 | private javax.swing.JLabel jLabel1;
173 | private javax.swing.JLabel jLabel2;
174 | private javax.swing.JLabel jLabel3;
175 | private javax.swing.JLabel jLabel4;
176 | private javax.swing.JLabel jLabel5;
177 | private javax.swing.JTextField jTextField1;
178 | private javax.swing.JTextField jTextField2;
179 | private javax.swing.JTextField t1;
180 | private javax.swing.JTextField t2;
181 | private javax.swing.JTextField t3;
182 | private javax.swing.JTextField t4;
183 | private javax.swing.JTextField t5;
184 | // End of variables declaration//GEN-END:variables
185 | }
186 |
--------------------------------------------------------------------------------
/src/LoginForm.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
164 |
--------------------------------------------------------------------------------
/src/LinkForm.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 | /**
8 | *
9 | * @author tanu
10 | */
11 | public class LinkForm extends javax.swing.JFrame {
12 |
13 | /**
14 | * Creates new form LinkForm
15 | */
16 | public LinkForm() {
17 | initComponents();
18 | }
19 |
20 | /**
21 | * This method is called from within the constructor to initialize the form.
22 | * WARNING: Do NOT modify this code. The content of this method is always
23 | * regenerated by the Form Editor.
24 | */
25 | @SuppressWarnings("unchecked")
26 | // //GEN-BEGIN:initComponents
27 | private void initComponents() {
28 |
29 | jLabel1 = new javax.swing.JLabel();
30 | jButton1 = new javax.swing.JButton();
31 | jButton2 = new javax.swing.JButton();
32 | jButton3 = new javax.swing.JButton();
33 | jButton4 = new javax.swing.JButton();
34 | jButton5 = new javax.swing.JButton();
35 | cDetails = new javax.swing.JButton();
36 | jButton6 = new javax.swing.JButton();
37 |
38 | jLabel1.setText("jLabel1");
39 |
40 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
41 |
42 | jButton1.setText("Adopt");
43 | jButton1.addActionListener(new java.awt.event.ActionListener() {
44 | public void actionPerformed(java.awt.event.ActionEvent evt) {
45 | jButton1ActionPerformed(evt);
46 | }
47 | });
48 |
49 | jButton2.setText(" For Staff ");
50 | jButton2.addActionListener(new java.awt.event.ActionListener() {
51 | public void actionPerformed(java.awt.event.ActionEvent evt) {
52 | jButton2ActionPerformed(evt);
53 | }
54 | });
55 |
56 | jButton3.setText("donation");
57 | jButton3.addActionListener(new java.awt.event.ActionListener() {
58 | public void actionPerformed(java.awt.event.ActionEvent evt) {
59 | jButton3ActionPerformed(evt);
60 | }
61 | });
62 |
63 | jButton4.setText("Parent");
64 | jButton4.addActionListener(new java.awt.event.ActionListener() {
65 | public void actionPerformed(java.awt.event.ActionEvent evt) {
66 | jButton4ActionPerformed(evt);
67 | }
68 | });
69 |
70 | jButton5.setText("Update");
71 | jButton5.addActionListener(new java.awt.event.ActionListener() {
72 | public void actionPerformed(java.awt.event.ActionEvent evt) {
73 | jButton5ActionPerformed(evt);
74 | }
75 | });
76 |
77 | cDetails.setText("For Child Details");
78 | cDetails.addActionListener(new java.awt.event.ActionListener() {
79 | public void actionPerformed(java.awt.event.ActionEvent evt) {
80 | cDetailsActionPerformed(evt);
81 | }
82 | });
83 |
84 | jButton6.setText("for admin");
85 | jButton6.addActionListener(new java.awt.event.ActionListener() {
86 | public void actionPerformed(java.awt.event.ActionEvent evt) {
87 | jButton6ActionPerformed(evt);
88 | }
89 | });
90 |
91 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
92 | getContentPane().setLayout(layout);
93 | layout.setHorizontalGroup(
94 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
95 | .addGroup(layout.createSequentialGroup()
96 | .addGap(136, 136, 136)
97 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
98 | .addGroup(layout.createSequentialGroup()
99 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
100 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
101 | .addComponent(jButton2)
102 | .addComponent(jButton4)
103 | .addComponent(jButton3)
104 | .addComponent(jButton5))
105 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
106 | .addGroup(layout.createSequentialGroup()
107 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
108 | .addComponent(jButton6)
109 | .addComponent(cDetails))
110 | .addGap(0, 155, Short.MAX_VALUE))))
111 | );
112 | layout.setVerticalGroup(
113 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
114 | .addGroup(layout.createSequentialGroup()
115 | .addGap(30, 30, 30)
116 | .addComponent(jButton1)
117 | .addGap(18, 18, 18)
118 | .addComponent(jButton2)
119 | .addGap(18, 18, 18)
120 | .addComponent(jButton3)
121 | .addGap(18, 18, 18)
122 | .addComponent(jButton4)
123 | .addGap(18, 18, 18)
124 | .addComponent(jButton5)
125 | .addGap(18, 18, 18)
126 | .addComponent(cDetails)
127 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
128 | .addComponent(jButton6))
129 | );
130 |
131 | pack();
132 | }// //GEN-END:initComponents
133 |
134 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
135 |
136 | }//GEN-LAST:event_jButton3ActionPerformed
137 |
138 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
139 |
140 | ChildDetails ch=new ChildDetails();
141 | ch.setVisible(true);
142 | }//GEN-LAST:event_jButton1ActionPerformed
143 |
144 | private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
145 |
146 | }//GEN-LAST:event_jButton4ActionPerformed
147 |
148 | private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
149 | Update up=new Update();
150 | up.setVisible(true);
151 | }//GEN-LAST:event_jButton5ActionPerformed
152 |
153 | private void cDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cDetailsActionPerformed
154 |
155 |
156 | }//GEN-LAST:event_cDetailsActionPerformed
157 |
158 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
159 |
160 | }//GEN-LAST:event_jButton2ActionPerformed
161 |
162 | private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
163 | ShowData sd=new ShowData();
164 | sd.setVisible(true);
165 | }//GEN-LAST:event_jButton6ActionPerformed
166 |
167 | /**
168 | * @param args the command line arguments
169 | */
170 | public static void main(String args[]) {
171 | /* Set the Nimbus look and feel */
172 | //
173 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
174 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
175 | */
176 | try {
177 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
178 | if ("Nimbus".equals(info.getName())) {
179 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
180 | break;
181 | }
182 | }
183 | } catch (ClassNotFoundException ex) {
184 | java.util.logging.Logger.getLogger(LinkForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
185 | } catch (InstantiationException ex) {
186 | java.util.logging.Logger.getLogger(LinkForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
187 | } catch (IllegalAccessException ex) {
188 | java.util.logging.Logger.getLogger(LinkForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
189 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
190 | java.util.logging.Logger.getLogger(LinkForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
191 | }
192 | //
193 |
194 | /* Create and display the form */
195 | java.awt.EventQueue.invokeLater(new Runnable() {
196 | public void run() {
197 | new LinkForm().setVisible(true);
198 | }
199 | });
200 | }
201 |
202 | // Variables declaration - do not modify//GEN-BEGIN:variables
203 | private javax.swing.JButton cDetails;
204 | private javax.swing.JButton jButton1;
205 | private javax.swing.JButton jButton2;
206 | private javax.swing.JButton jButton3;
207 | private javax.swing.JButton jButton4;
208 | private javax.swing.JButton jButton5;
209 | private javax.swing.JButton jButton6;
210 | private javax.swing.JLabel jLabel1;
211 | // End of variables declaration//GEN-END:variables
212 | }
213 |
--------------------------------------------------------------------------------
/src/LoginForm.java:
--------------------------------------------------------------------------------
1 |
2 | import java.sql.Connection;
3 | import java.sql.PreparedStatement;
4 | import java.sql.ResultSet;
5 | import java.sql.SQLException;
6 | import java.sql.Statement;
7 | import java.util.logging.Level;
8 | import java.util.logging.Logger;
9 |
10 | /*
11 | * To change this license header, choose License Headers in Project Properties.
12 | * To change this template file, choose Tools | Templates
13 | * and open the template in the editor.
14 | */
15 |
16 | /**
17 | *
18 | * @author tanu
19 | */
20 | public class LoginForm extends javax.swing.JFrame {
21 |
22 | /**
23 | * Creates new form LoginForm
24 | */
25 | private Connection con;
26 | private PreparedStatement ps;
27 | private Statement stmt;
28 | String sql;
29 | public LoginForm() {
30 | initComponents();
31 | /* con=Data.connect();
32 | //sql="select from staff where id=? AND password=?";
33 | try {
34 | ps=con.prepareStatement(sql);
35 | stmt=con.createStatement();
36 | } catch (Exception ex) {
37 | System.out.println(ex);
38 | }*/
39 | }
40 |
41 | /**
42 | * This method is called from within the constructor to initialize the form.
43 | * WARNING: Do NOT modify this code. The content of this method is always
44 | * regenerated by the Form Editor.
45 | */
46 | @SuppressWarnings("unchecked")
47 | // //GEN-BEGIN:initComponents
48 | private void initComponents() {
49 |
50 | jPanel1 = new javax.swing.JPanel();
51 | jLabel4 = new javax.swing.JLabel();
52 | jLabel3 = new javax.swing.JLabel();
53 | jLabel5 = new javax.swing.JLabel();
54 | jButton2 = new javax.swing.JButton();
55 | jButton1 = new javax.swing.JButton();
56 | jLabel6 = new javax.swing.JLabel();
57 | jLabel2 = new javax.swing.JLabel();
58 | t1 = new javax.swing.JTextField();
59 | jLabel1 = new javax.swing.JLabel();
60 | jLabel7 = new javax.swing.JLabel();
61 | t3 = new javax.swing.JPasswordField();
62 |
63 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
64 |
65 | jPanel1.setForeground(new java.awt.Color(102, 0, 0));
66 | jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
67 | jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(135, 175, -1, -1));
68 |
69 | jLabel3.setText("LOGIN FORM");
70 | jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(246, 47, -1, -1));
71 |
72 | jLabel5.setText("jLabel5");
73 | jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(433, 282, -1, -1));
74 |
75 | jButton2.setText("Sign Up");
76 | jButton2.addActionListener(new java.awt.event.ActionListener() {
77 | public void actionPerformed(java.awt.event.ActionEvent evt) {
78 | jButton2ActionPerformed(evt);
79 | }
80 | });
81 | jPanel1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(337, 241, -1, -1));
82 |
83 | jButton1.setBackground(new java.awt.Color(255, 255, 255));
84 | jButton1.setText("Sign In");
85 | jButton1.addActionListener(new java.awt.event.ActionListener() {
86 | public void actionPerformed(java.awt.event.ActionEvent evt) {
87 | jButton1ActionPerformed(evt);
88 | }
89 | });
90 | jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(66, 241, -1, -1));
91 |
92 | jLabel6.setText("jLabel6");
93 | jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(649, 115, -1, -1));
94 |
95 | jLabel2.setText("PASSWORD");
96 | jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 176, -1, -1));
97 | jPanel1.add(t1, new org.netbeans.lib.awtextra.AbsoluteConstraints(237, 112, 169, -1));
98 |
99 | jLabel1.setText("ID");
100 | jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 115, 32, -1));
101 |
102 | jLabel7.setIcon(new javax.swing.ImageIcon("C:\\Users\\Muska\\Downloads\\WhatsApp Image 2019-11-17 at 11.02.22 AM.jpeg")); // NOI18N
103 | jLabel7.setText("jLabel7");
104 | jPanel1.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 674, 350));
105 | jPanel1.add(t3, new org.netbeans.lib.awtextra.AbsoluteConstraints(237, 173, 169, -1));
106 |
107 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
108 | getContentPane().setLayout(layout);
109 | layout.setHorizontalGroup(
110 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
111 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
112 | );
113 | layout.setVerticalGroup(
114 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
115 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
116 | );
117 |
118 | pack();
119 | }// //GEN-END:initComponents
120 |
121 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
122 |
123 | SignUpPage signup=new SignUpPage();
124 | signup.setVisible(true);
125 |
126 | // TODO add your handling code here:
127 |
128 | }//GEN-LAST:event_jButton2ActionPerformed
129 |
130 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
131 | // TODO add your handling code here:
132 |
133 | String i=t1.getText();
134 | String p=t3.getText();
135 | if(i.equals("")||p.equals("")){
136 | jLabel5.setText("please fill Login ID and Password");
137 | }
138 |
139 | else{
140 | con=Data.connect();
141 | sql="select *from staff where id=? and password=?";
142 | try {
143 | int id=(Integer.parseInt(i));
144 | ps=con.prepareStatement(sql);
145 | //stmt=con.createStatement();
146 | ps.setString(1,i);
147 | ps.setString(2, p);
148 | ResultSet rs=ps.executeQuery();
149 | boolean b=rs.next();
150 | if(b==true)
151 | {
152 |
153 | LinkForm lf=new LinkForm();
154 | lf.setVisible(true);
155 | }
156 | else
157 | {
158 | jLabel5.setText("invalid id and password");
159 | t1.setText("");
160 | t3.setText("");
161 | }
162 |
163 | } catch (Exception ex) {
164 | jLabel6.setText("enter only digits");
165 | t1.setText("");
166 | }
167 |
168 | /* if(i.equals("12") && p.equals("123456"))
169 | {
170 | LinkForm lf=new LinkForm();
171 | lf.setVisible(true);
172 |
173 | }*/
174 |
175 | }
176 |
177 | }//GEN-LAST:event_jButton1ActionPerformed
178 |
179 | /**
180 | * @param args the command line arguments
181 | */
182 | public static void main(String args[]) {
183 | /* Set the Nimbus look and feel */
184 | //
185 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
186 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
187 | */
188 | try {
189 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
190 | if ("Nimbus".equals(info.getName())) {
191 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
192 | break;
193 | }
194 | }
195 | } catch (ClassNotFoundException ex) {
196 | java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
197 | } catch (InstantiationException ex) {
198 | java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
199 | } catch (IllegalAccessException ex) {
200 | java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
201 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
202 | java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
203 | }
204 | //
205 |
206 | /* Create and display the form */
207 | java.awt.EventQueue.invokeLater(new Runnable() {
208 | public void run() {
209 | new LoginForm().setVisible(true);
210 | }
211 | });
212 | }
213 |
214 | // Variables declaration - do not modify//GEN-BEGIN:variables
215 | private javax.swing.JButton jButton1;
216 | private javax.swing.JButton jButton2;
217 | private javax.swing.JLabel jLabel1;
218 | private javax.swing.JLabel jLabel2;
219 | private javax.swing.JLabel jLabel3;
220 | private javax.swing.JLabel jLabel4;
221 | private javax.swing.JLabel jLabel5;
222 | private javax.swing.JLabel jLabel6;
223 | private javax.swing.JLabel jLabel7;
224 | private javax.swing.JPanel jPanel1;
225 | private javax.swing.JTextField t1;
226 | private javax.swing.JPasswordField t3;
227 | // End of variables declaration//GEN-END:variables
228 | }
229 |
--------------------------------------------------------------------------------
/src/SignUpPage.java:
--------------------------------------------------------------------------------
1 |
2 | import java.sql.Connection;
3 | import java.sql.PreparedStatement;
4 | import java.sql.ResultSet;
5 | import java.sql.SQLException;
6 | import java.sql.Statement;
7 | import java.util.logging.Level;
8 | import java.util.logging.Logger;
9 |
10 | /*
11 | * To change this license header, choose License Headers in Project Properties.
12 | * To change this template file, choose Tools | Templates
13 | * and open the template in the editor.
14 | */
15 |
16 | /**
17 | *
18 | * @author tanu
19 | */
20 | public class SignUpPage extends javax.swing.JFrame {
21 |
22 | /**
23 | * Creates new form SignUpPage
24 | */
25 | private Connection con;
26 | private PreparedStatement ps;
27 | LinkForm l;
28 | public SignUpPage() {
29 | initComponents();
30 | }
31 |
32 | /**
33 | * This method is called from within the constructor to initialize the form.
34 | * WARNING: Do NOT modify this code. The content of this method is always
35 | * regenerated by the Form Editor.
36 | */
37 | @SuppressWarnings("unchecked")
38 | // //GEN-BEGIN:initComponents
39 | private void initComponents() {
40 |
41 | jLabel1 = new javax.swing.JLabel();
42 | jLabel2 = new javax.swing.JLabel();
43 | t1 = new javax.swing.JTextField();
44 | t2 = new javax.swing.JTextField();
45 | jButton1 = new javax.swing.JButton();
46 | jLabel3 = new javax.swing.JLabel();
47 | jLabel4 = new javax.swing.JLabel();
48 |
49 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
50 |
51 | jLabel1.setText("Id");
52 |
53 | jLabel2.setText("Create password");
54 |
55 | jButton1.setText("OK");
56 | jButton1.addActionListener(new java.awt.event.ActionListener() {
57 | public void actionPerformed(java.awt.event.ActionEvent evt) {
58 | jButton1ActionPerformed(evt);
59 | }
60 | });
61 |
62 | jLabel3.setText("jLabel3");
63 |
64 | jLabel4.setText("jLabel4");
65 |
66 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
67 | getContentPane().setLayout(layout);
68 | layout.setHorizontalGroup(
69 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
70 | .addGroup(layout.createSequentialGroup()
71 | .addGap(79, 79, 79)
72 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
73 | .addGroup(layout.createSequentialGroup()
74 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
75 | .addGroup(layout.createSequentialGroup()
76 | .addComponent(jLabel2)
77 | .addGap(18, 18, 18)
78 | .addComponent(t2))
79 | .addGroup(layout.createSequentialGroup()
80 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
81 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
82 | .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)))
83 | .addGap(72, 72, 72))
84 | .addGroup(layout.createSequentialGroup()
85 | .addGap(97, 97, 97)
86 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
87 | .addContainerGap())))
88 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
89 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
90 | .addComponent(jButton1)
91 | .addGap(157, 157, 157))
92 | .addGroup(layout.createSequentialGroup()
93 | .addGap(104, 104, 104)
94 | .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
95 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
96 | );
97 | layout.setVerticalGroup(
98 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
99 | .addGroup(layout.createSequentialGroup()
100 | .addGap(41, 41, 41)
101 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
102 | .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
103 | .addComponent(jLabel1))
104 | .addGap(18, 18, 18)
105 | .addComponent(jLabel3)
106 | .addGap(36, 36, 36)
107 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
108 | .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
109 | .addComponent(jLabel2))
110 | .addGap(54, 54, 54)
111 | .addComponent(jButton1)
112 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
113 | .addComponent(jLabel4)
114 | .addContainerGap(49, Short.MAX_VALUE))
115 | );
116 |
117 | pack();
118 | }// //GEN-END:initComponents
119 |
120 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
121 |
122 | String id=t1.getText();
123 |
124 | String pass=t2.getText();
125 | if(id.equals("")||pass.equals(""))
126 | {
127 | jLabel4.setText("fill id and password");
128 |
129 | }
130 | if(pass.length()>8)
131 | {
132 | jLabel4.setText("password at most of 8 digit or cahracter");
133 | // SignUpPage s=new SignUpPage();
134 | //s.setVisible(true);
135 |
136 |
137 | }
138 |
139 |
140 | // TODO add your handling code here:
141 | else{
142 | con=Data.connect();
143 | String sql=" select *from staff where id=? and password=null ";
144 | try {
145 | ps=con.prepareStatement(sql);
146 | ps.setString(1, id);
147 |
148 |
149 |
150 | ResultSet rs=ps.executeQuery();
151 | boolean b=rs.next();
152 | if(b==false)
153 | {
154 |
155 | jLabel3.setText("id is invalid or already exist");
156 | }
157 |
158 | else{
159 |
160 | int s=Integer.parseInt((rs.getString(1)));
161 | String sql1="update staff set password=? where id=? ";
162 | ps=con.prepareStatement(sql1);
163 | ps.setString(1,pass);
164 | ps.setString(2,id);
165 | ps.executeUpdate();
166 |
167 | l=new LinkForm();
168 | l.setVisible(true);
169 | con.close();
170 | }
171 |
172 | }
173 |
174 |
175 |
176 |
177 |
178 | catch (Exception ex) {
179 | System.out.println(ex);
180 | }
181 | }
182 | t1.setText(" ");
183 | t2.setText(" ");
184 | }//GEN-LAST:event_jButton1ActionPerformed
185 |
186 |
187 | /**
188 | } * @param args the command line arguments
189 | */
190 | public static void main(String args[]) {
191 | /* Set the Nimbus look and feel */
192 | //
193 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
194 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
195 | */
196 | try {
197 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
198 | if ("Nimbus".equals(info.getName())) {
199 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
200 | break;
201 | }
202 | }
203 | } catch (ClassNotFoundException ex) {
204 | java.util.logging.Logger.getLogger(SignUpPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
205 | } catch (InstantiationException ex) {
206 | java.util.logging.Logger.getLogger(SignUpPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
207 | } catch (IllegalAccessException ex) {
208 | java.util.logging.Logger.getLogger(SignUpPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
209 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
210 | java.util.logging.Logger.getLogger(SignUpPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
211 | }
212 | //
213 |
214 | /* Create and display the form */
215 | java.awt.EventQueue.invokeLater(new Runnable() {
216 | public void run() {
217 | new SignUpPage().setVisible(true);
218 | }
219 | });
220 | }
221 |
222 | // Variables declaration - do not modify//GEN-BEGIN:variables
223 | private javax.swing.JButton jButton1;
224 | private javax.swing.JLabel jLabel1;
225 | private javax.swing.JLabel jLabel2;
226 | private javax.swing.JLabel jLabel3;
227 | private javax.swing.JLabel jLabel4;
228 | private javax.swing.JTextField t1;
229 | private javax.swing.JTextField t2;
230 | // End of variables declaration//GEN-END:variables
231 | }
232 |
--------------------------------------------------------------------------------
/src/DonationForm.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
197 |
--------------------------------------------------------------------------------
/src/ChildDetails.java:
--------------------------------------------------------------------------------
1 |
2 | import static com.oracle.jrockit.jfr.ContentType.Bytes;
3 | import java.awt.Image;
4 | import java.awt.Toolkit;
5 | import java.awt.event.ItemEvent;
6 | import java.awt.event.ItemListener;
7 | import java.awt.event.MouseEvent;
8 | import java.awt.event.MouseListener;
9 | import java.sql.Connection;
10 | import java.sql.PreparedStatement;
11 | import java.sql.ResultSet;
12 | import java.sql.ResultSetMetaData;
13 | import java.sql.SQLException;
14 | import java.sql.Statement;
15 | import java.util.logging.Level;
16 | import java.util.logging.Logger;
17 | import javax.swing.ImageIcon;
18 | import javax.swing.JButton;
19 | import javax.swing.JComboBox;
20 | import javax.swing.JLabel;
21 | import javax.swing.JTable;
22 | import javax.swing.ListSelectionModel;
23 | import javax.swing.table.DefaultTableModel;
24 | import javax.swing.table.TableModel;
25 |
26 | /*
27 | * To change this license header, choose License Headers in Project Properties.
28 | * To change this template file, choose Tools | Templates
29 | * and open the template in the editor.
30 | */
31 |
32 | /**
33 | *
34 | * @author tanu
35 | */
36 | public class ChildDetails extends javax.swing.JFrame {
37 |
38 | /**
39 | * Creates new form ChildDetails
40 | */
41 | private Connection con;
42 | private PreparedStatement ps;
43 | // label3 = new JLabel();
44 | public ChildDetails() {
45 | initComponents();
46 | con=Data.connect();
47 | childData();
48 |
49 |
50 | }
51 | void childData()
52 | {
53 | String sql="select*from child";
54 | Statement stm;
55 | try {
56 | stm = con.createStatement();
57 | String[] tableColumnsName={" Id","name","age","class","BloodG","HealthIss","image","Action"};
58 | DefaultTableModel aModel=(DefaultTableModel)Table1.getModel();
59 | aModel.setColumnIdentifiers(tableColumnsName);
60 | ResultSet rs= stm.executeQuery(sql);
61 | ResultSetMetaData rsmd=rs.getMetaData();
62 | int colno=rsmd.getColumnCount();
63 |
64 |
65 |
66 | while(rs.next())
67 | {
68 | Object[] obj=new Object[colno];
69 | for(int i=0;i//GEN-BEGIN:initComponents
170 | private void initComponents() {
171 |
172 | jLabel2 = new javax.swing.JLabel();
173 | jLabel1 = new javax.swing.JLabel();
174 | jScrollPane1 = new javax.swing.JScrollPane();
175 | Table1 = new javax.swing.JTable();
176 |
177 | jLabel2.setText("jLabel2");
178 |
179 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
180 |
181 | jLabel1.setText("Child Details");
182 |
183 | Table1.setModel(new javax.swing.table.DefaultTableModel(
184 | new Object [][] {
185 |
186 | },
187 | new String [] {
188 | "Id", "Name", "Age", "Class", "bloodG", "healthIss", "image", "Action"
189 | }
190 | ) {
191 | Class[] types = new Class [] {
192 | java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Byte.class, java.lang.Object.class
193 | };
194 |
195 | public Class getColumnClass(int columnIndex) {
196 | return types [columnIndex];
197 | }
198 | });
199 | Table1.addMouseListener(new java.awt.event.MouseAdapter() {
200 | public void mouseClicked(java.awt.event.MouseEvent evt) {
201 | Table1MouseClicked(evt);
202 | }
203 | });
204 | jScrollPane1.setViewportView(Table1);
205 |
206 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
207 | getContentPane().setLayout(layout);
208 | layout.setHorizontalGroup(
209 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
210 | .addGroup(layout.createSequentialGroup()
211 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
212 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 473, javax.swing.GroupLayout.PREFERRED_SIZE)
213 | .addGroup(layout.createSequentialGroup()
214 | .addGap(219, 219, 219)
215 | .addComponent(jLabel1)
216 | .addGap(221, 221, 221)))
217 | .addContainerGap(266, Short.MAX_VALUE))
218 | );
219 | layout.setVerticalGroup(
220 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
221 | .addGroup(layout.createSequentialGroup()
222 | .addContainerGap()
223 | .addComponent(jLabel1)
224 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
225 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)
226 | .addContainerGap(219, Short.MAX_VALUE))
227 | );
228 |
229 | pack();
230 | }// //GEN-END:initComponents
231 |
232 | private void Table1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Table1MouseClicked
233 | // TODO add your handling code here:
234 |
235 | }//GEN-LAST:event_Table1MouseClicked
236 |
237 | /**
238 | * @param args the command line arguments
239 | */
240 | public static void main(String args[]) {
241 | /* Set the Nimbus look and feel */
242 | //
243 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
244 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
245 | */
246 | try {
247 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
248 | if ("Nimbus".equals(info.getName())) {
249 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
250 | break;
251 | }
252 | }
253 | } catch (ClassNotFoundException ex) {
254 | java.util.logging.Logger.getLogger(ChildDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
255 | } catch (InstantiationException ex) {
256 | java.util.logging.Logger.getLogger(ChildDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
257 | } catch (IllegalAccessException ex) {
258 | java.util.logging.Logger.getLogger(ChildDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
259 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
260 | java.util.logging.Logger.getLogger(ChildDetails.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
261 | }
262 | //
263 |
264 | /* Create and display the form */
265 | java.awt.EventQueue.invokeLater(new Runnable() {
266 | public void run() {
267 | new ChildDetails().setVisible(true);
268 | }
269 | });
270 | }
271 |
272 | // Variables declaration - do not modify//GEN-BEGIN:variables
273 | private javax.swing.JTable Table1;
274 | private javax.swing.JLabel jLabel1;
275 | private javax.swing.JLabel jLabel2;
276 | private javax.swing.JScrollPane jScrollPane1;
277 | // End of variables declaration//GEN-END:variables
278 |
279 | //To change body of generated methods, choose Tools | Templates.
280 |
281 |
282 |
--------------------------------------------------------------------------------
/src/StaffForm.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
236 |
--------------------------------------------------------------------------------
/src/DonationForm.java:
--------------------------------------------------------------------------------
1 |
2 | import java.sql.Connection;
3 | import java.sql.PreparedStatement;
4 | import java.sql.ResultSet;
5 | import java.sql.SQLException;
6 | import java.util.logging.Level;
7 | import java.util.logging.Logger;
8 |
9 | /*
10 | * To change this license header, choose License Headers in Project Properties.
11 | * To change this template file, choose Tools | Templates
12 | * and open the template in the editor.
13 | */
14 |
15 | /**
16 | *
17 | * @author tanu
18 | */
19 | public class DonationForm extends javax.swing.JFrame {
20 |
21 | /**
22 | * Creates new form DonationForm
23 | */
24 | Connection con;
25 | PreparedStatement ps;
26 | public DonationForm() {
27 | initComponents();
28 | con=Data.connect();
29 | }
30 |
31 | /**
32 | * This method is called from within the constructor to initialize the form.
33 | * WARNING: Do NOT modify this code. The content of this method is always
34 | * regenerated by the Form Editor.
35 | */
36 | @SuppressWarnings("unchecked")
37 | // //GEN-BEGIN:initComponents
38 | private void initComponents() {
39 |
40 | jLabel1 = new javax.swing.JLabel();
41 | jLabel2 = new javax.swing.JLabel();
42 | jLabel3 = new javax.swing.JLabel();
43 | jLabel4 = new javax.swing.JLabel();
44 | t6 = new javax.swing.JTextField();
45 | t7 = new javax.swing.JTextField();
46 | t8 = new javax.swing.JTextField();
47 | t5 = new javax.swing.JTextField();
48 | jButton1 = new javax.swing.JButton();
49 | jLabel5 = new javax.swing.JLabel();
50 | jLabel6 = new javax.swing.JLabel();
51 | jLabel7 = new javax.swing.JLabel();
52 | t1 = new javax.swing.JTextField();
53 | t2 = new javax.swing.JTextField();
54 | t3 = new javax.swing.JTextField();
55 | jLabel8 = new javax.swing.JLabel();
56 | t4 = new javax.swing.JTextField();
57 | jLabel9 = new javax.swing.JLabel();
58 |
59 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
60 |
61 | jLabel1.setText("Account No.");
62 |
63 | jLabel2.setText("IFSC Code");
64 |
65 | jLabel3.setText("Bank Name");
66 |
67 | jLabel4.setText("Amount");
68 |
69 | t5.addActionListener(new java.awt.event.ActionListener() {
70 | public void actionPerformed(java.awt.event.ActionEvent evt) {
71 | t5ActionPerformed(evt);
72 | }
73 | });
74 |
75 | jButton1.setText("Submit");
76 | jButton1.addActionListener(new java.awt.event.ActionListener() {
77 | public void actionPerformed(java.awt.event.ActionEvent evt) {
78 | jButton1ActionPerformed(evt);
79 | }
80 | });
81 |
82 | jLabel5.setText("Name");
83 |
84 | jLabel6.setText("Mobile no");
85 |
86 | jLabel7.setText("Email Id");
87 |
88 | jLabel8.setText("Mode of transfer");
89 |
90 | jLabel9.setText("jLabel9");
91 |
92 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
93 | getContentPane().setLayout(layout);
94 | layout.setHorizontalGroup(
95 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
96 | .addGroup(layout.createSequentialGroup()
97 | .addGap(85, 85, 85)
98 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
99 | .addComponent(jLabel1)
100 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
101 | .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING)
102 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
103 | .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
104 | .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)))
105 | .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
106 | .addComponent(jLabel8)
107 | .addComponent(jLabel2)
108 | .addComponent(jLabel3))
109 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 120, Short.MAX_VALUE)
110 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
111 | .addComponent(t8, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
112 | .addComponent(t5, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
113 | .addComponent(t7, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
114 | .addComponent(t6, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
115 | .addComponent(t3, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
116 | .addComponent(t2, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
117 | .addComponent(t1, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
118 | .addComponent(t4))
119 | .addGap(160, 160, 160))
120 | .addGroup(layout.createSequentialGroup()
121 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
122 | .addGroup(layout.createSequentialGroup()
123 | .addGap(253, 253, 253)
124 | .addComponent(jButton1))
125 | .addGroup(layout.createSequentialGroup()
126 | .addGap(179, 179, 179)
127 | .addComponent(jLabel9)))
128 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
129 | );
130 | layout.setVerticalGroup(
131 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132 | .addGroup(layout.createSequentialGroup()
133 | .addContainerGap(74, Short.MAX_VALUE)
134 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
135 | .addComponent(jLabel5)
136 | .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
137 | .addGap(18, 18, 18)
138 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
139 | .addComponent(jLabel7)
140 | .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
141 | .addGap(18, 18, 18)
142 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
143 | .addComponent(jLabel6)
144 | .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
145 | .addGap(18, 18, 18)
146 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
147 | .addComponent(jLabel8)
148 | .addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
149 | .addGap(18, 18, 18)
150 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
151 | .addComponent(jLabel3)
152 | .addComponent(t5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
153 | .addGap(18, 18, 18)
154 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
155 | .addComponent(jLabel1)
156 | .addComponent(t6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
157 | .addGap(18, 18, 18)
158 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
159 | .addComponent(jLabel2)
160 | .addComponent(t7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
161 | .addGap(18, 18, 18)
162 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
163 | .addComponent(jLabel4)
164 | .addComponent(t8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
165 | .addGap(45, 45, 45)
166 | .addComponent(jButton1)
167 | .addGap(18, 18, 18)
168 | .addComponent(jLabel9)
169 | .addGap(43, 43, 43))
170 | );
171 |
172 | pack();
173 | }// //GEN-END:initComponents
174 |
175 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
176 | // TODO add your handling code here:
177 |
178 | String name=t1.getText();
179 | String email=t2.getText();
180 | String mobile=t3.getText();
181 | String mode=t4.getText();
182 | String bank=t5.getText();
183 | String acc=t6.getText();
184 | String ifsc=t7.getText();
185 | String amt=t8.getText();
186 | String sql="insert into Donation values(?,?,?,?,?,?,?,?)";
187 | try {
188 |
189 |
190 | if(acc.length()==14||ifsc.length()==11||mobile.length()==10)
191 | {
192 |
193 |
194 | ps=con.prepareStatement(sql);
195 | ps.setString(1,name);
196 | ps.setString(2,email);
197 | ps.setString(3,mobile);
198 | ps.setString(4,mode);
199 | ps.setString(5,bank);
200 | ps.setString(6,acc);
201 | ps.setString(7,ifsc);
202 | ps.setInt(8,Integer.parseInt(amt));
203 | ps.executeUpdate();
204 | t1.setText("");
205 | t2.setText("");
206 | t3.setText("");
207 | t4.setText("");
208 | t5.setText("");
209 | t6.setText("");
210 |
211 | t7.setText("");
212 | t8.setText("") ;
213 | }
214 | else
215 | {
216 |
217 | jLabel9.setText("you have to enter proper details");
218 |
219 | t3.setText("");
220 | t4.setText("");
221 | t5.setText("");
222 |
223 |
224 | }
225 | } catch (SQLException ex) {
226 | jLabel7.setText("please enter correct digit");
227 | t8.setText("") ;
228 |
229 | }
230 | }//GEN-LAST:event_jButton1ActionPerformed
231 |
232 | private void t5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_t5ActionPerformed
233 | // TODO add your handling code here:
234 | }//GEN-LAST:event_t5ActionPerformed
235 |
236 | /**
237 | * @param args the command line arguments
238 | */
239 | public static void main(String args[]) {
240 | /* Set the Nimbus look and feel */
241 | //
242 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
243 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
244 | */
245 | try {
246 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
247 | if ("Nimbus".equals(info.getName())) {
248 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
249 | break;
250 | }
251 | }
252 | } catch (ClassNotFoundException ex) {
253 | java.util.logging.Logger.getLogger(DonationForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
254 | } catch (InstantiationException ex) {
255 | java.util.logging.Logger.getLogger(DonationForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
256 | } catch (IllegalAccessException ex) {
257 | java.util.logging.Logger.getLogger(DonationForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
258 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
259 | java.util.logging.Logger.getLogger(DonationForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
260 | }
261 | //
262 |
263 | /* Create and display the form */
264 | java.awt.EventQueue.invokeLater(new Runnable() {
265 | public void run() {
266 | new DonationForm().setVisible(true);
267 | }
268 | });
269 | }
270 |
271 | // Variables declaration - do not modify//GEN-BEGIN:variables
272 | private javax.swing.JButton jButton1;
273 | private javax.swing.JLabel jLabel1;
274 | private javax.swing.JLabel jLabel2;
275 | private javax.swing.JLabel jLabel3;
276 | private javax.swing.JLabel jLabel4;
277 | private javax.swing.JLabel jLabel5;
278 | private javax.swing.JLabel jLabel6;
279 | private javax.swing.JLabel jLabel7;
280 | private javax.swing.JLabel jLabel8;
281 | private javax.swing.JLabel jLabel9;
282 | private javax.swing.JTextField t1;
283 | private javax.swing.JTextField t2;
284 | private javax.swing.JTextField t3;
285 | private javax.swing.JTextField t4;
286 | private javax.swing.JTextField t5;
287 | private javax.swing.JTextField t6;
288 | private javax.swing.JTextField t7;
289 | private javax.swing.JTextField t8;
290 | // End of variables declaration//GEN-END:variables
291 | }
292 |
--------------------------------------------------------------------------------
/src/ChildForm.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
271 |
--------------------------------------------------------------------------------
/src/ChildForm.java:
--------------------------------------------------------------------------------
1 | import java.io.ByteArrayOutputStream;
2 | import java.io.File;
3 | import java.io.FileInputStream;
4 | import java.sql.Connection;
5 | import java.sql.PreparedStatement;
6 | import java.sql.SQLException;
7 | import java.util.logging.Level;
8 | import java.util.logging.Logger;
9 | import javax.swing.ImageIcon;
10 | import javax.swing.JFileChooser;
11 | import javax.swing.JOptionPane;
12 |
13 | /*
14 | * To change this license header, choose License Headers in Project Properties.
15 | * To change this template file, choose Tools | Templates
16 | * and open the template in the editor.
17 | */
18 |
19 | /**
20 | *
21 | * @author tanu
22 | */
23 | public class ChildForm extends javax.swing.JFrame {
24 | private Connection con;
25 | private PreparedStatement ps;
26 | /**
27 | * Creates new form ChildForm
28 | */
29 |
30 | byte[] photo=null;
31 | String filename=null;
32 | public ChildForm() {
33 | initComponents();
34 | con=Data.connect();
35 |
36 | }
37 |
38 | /**
39 | * This method is called from within the constructor to initialize the form.
40 | * WARNING: Do NOT modify this code. The content of this method is always
41 | * regenerated by the Form Editor.
42 | */
43 | @SuppressWarnings("unchecked")
44 | // //GEN-BEGIN:initComponents
45 | private void initComponents() {
46 |
47 | jLabel1 = new javax.swing.JLabel();
48 | jLabel2 = new javax.swing.JLabel();
49 | jLabel3 = new javax.swing.JLabel();
50 | jLabel4 = new javax.swing.JLabel();
51 | t2 = new javax.swing.JTextField();
52 | t3 = new javax.swing.JTextField();
53 | t4 = new javax.swing.JTextField();
54 | t5 = new javax.swing.JTextField();
55 | jLabel5 = new javax.swing.JLabel();
56 | t6 = new javax.swing.JTextField();
57 | jButton1 = new javax.swing.JButton();
58 | jButton2 = new javax.swing.JButton();
59 | jDesktopPane1 = new javax.swing.JDesktopPane();
60 | jLabel7 = new javax.swing.JLabel();
61 | jLabel8 = new javax.swing.JLabel();
62 | t1 = new javax.swing.JTextField();
63 | t7 = new javax.swing.JTextField();
64 | jLabel6 = new javax.swing.JLabel();
65 | jLabel9 = new javax.swing.JLabel();
66 |
67 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
68 |
69 | jLabel1.setText("Name");
70 |
71 | jLabel2.setText("Age");
72 |
73 | jLabel3.setText("Class");
74 |
75 | jLabel4.setText("Blood Group");
76 |
77 | t2.addActionListener(new java.awt.event.ActionListener() {
78 | public void actionPerformed(java.awt.event.ActionEvent evt) {
79 | t2ActionPerformed(evt);
80 | }
81 | });
82 |
83 | t3.addActionListener(new java.awt.event.ActionListener() {
84 | public void actionPerformed(java.awt.event.ActionEvent evt) {
85 | t3ActionPerformed(evt);
86 | }
87 | });
88 |
89 | t4.addActionListener(new java.awt.event.ActionListener() {
90 | public void actionPerformed(java.awt.event.ActionEvent evt) {
91 | t4ActionPerformed(evt);
92 | }
93 | });
94 |
95 | t5.addActionListener(new java.awt.event.ActionListener() {
96 | public void actionPerformed(java.awt.event.ActionEvent evt) {
97 | t5ActionPerformed(evt);
98 | }
99 | });
100 |
101 | jLabel5.setText("Health Issue");
102 |
103 | t6.addActionListener(new java.awt.event.ActionListener() {
104 | public void actionPerformed(java.awt.event.ActionEvent evt) {
105 | t6ActionPerformed(evt);
106 | }
107 | });
108 |
109 | jButton1.setText("Submit");
110 | jButton1.addActionListener(new java.awt.event.ActionListener() {
111 | public void actionPerformed(java.awt.event.ActionEvent evt) {
112 | jButton1ActionPerformed(evt);
113 | }
114 | });
115 |
116 | jButton2.setText("upload");
117 | jButton2.addActionListener(new java.awt.event.ActionListener() {
118 | public void actionPerformed(java.awt.event.ActionEvent evt) {
119 | jButton2ActionPerformed(evt);
120 | }
121 | });
122 |
123 | jDesktopPane1.setMaximumSize(new java.awt.Dimension(208, 212));
124 | jDesktopPane1.setMinimumSize(new java.awt.Dimension(208, 212));
125 |
126 | jLabel7.setText("jLabel7");
127 |
128 | jDesktopPane1.setLayer(jLabel7, javax.swing.JLayeredPane.DEFAULT_LAYER);
129 |
130 | javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1);
131 | jDesktopPane1.setLayout(jDesktopPane1Layout);
132 | jDesktopPane1Layout.setHorizontalGroup(
133 | jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
134 | .addGroup(jDesktopPane1Layout.createSequentialGroup()
135 | .addContainerGap()
136 | .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
137 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
138 | );
139 | jDesktopPane1Layout.setVerticalGroup(
140 | jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
141 | .addGroup(jDesktopPane1Layout.createSequentialGroup()
142 | .addContainerGap()
143 | .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
144 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
145 | );
146 |
147 | jLabel8.setText("Id");
148 |
149 | t7.setText("jTextField1");
150 |
151 | jLabel6.setText("jLabel6");
152 |
153 | jLabel9.setText("jLabel9");
154 |
155 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
156 | getContentPane().setLayout(layout);
157 | layout.setHorizontalGroup(
158 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
159 | .addGroup(layout.createSequentialGroup()
160 | .addGap(105, 105, 105)
161 | .addComponent(jLabel9)
162 | .addGap(56, 56, 56)
163 | .addComponent(jButton1)
164 | .addContainerGap(368, Short.MAX_VALUE))
165 | .addGroup(layout.createSequentialGroup()
166 | .addGap(92, 92, 92)
167 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
168 | .addComponent(jLabel1)
169 | .addComponent(jLabel3)
170 | .addComponent(jLabel4)
171 | .addComponent(jLabel5)
172 | .addComponent(jLabel2)
173 | .addComponent(jLabel8)
174 | .addComponent(t7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
175 | .addGap(82, 82, 82)
176 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
177 | .addComponent(t3)
178 | .addComponent(t2)
179 | .addComponent(t4)
180 | .addComponent(t5)
181 | .addComponent(t6, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
182 | .addComponent(jButton2)
183 | .addComponent(t1))
184 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
185 | .addGroup(layout.createSequentialGroup()
186 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
187 | .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
188 | .addGap(48, 48, 48))
189 | .addGroup(layout.createSequentialGroup()
190 | .addGap(50, 50, 50)
191 | .addComponent(jLabel6)
192 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
193 | );
194 | layout.setVerticalGroup(
195 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
196 | .addGroup(layout.createSequentialGroup()
197 | .addContainerGap()
198 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
199 | .addComponent(jLabel8)
200 | .addComponent(t1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
201 | .addComponent(jLabel6))
202 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
203 | .addGroup(layout.createSequentialGroup()
204 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
205 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
206 | .addComponent(jLabel1)
207 | .addComponent(t2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
208 | .addGap(18, 18, 18)
209 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
210 | .addComponent(jLabel2)
211 | .addComponent(t3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
212 | .addGap(26, 26, 26)
213 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
214 | .addComponent(t4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
215 | .addComponent(jLabel3))
216 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
217 | .addGroup(layout.createSequentialGroup()
218 | .addGap(20, 20, 20)
219 | .addComponent(jLabel4))
220 | .addGroup(layout.createSequentialGroup()
221 | .addGap(18, 18, 18)
222 | .addComponent(t5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
223 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
224 | .addGroup(layout.createSequentialGroup()
225 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
226 | .addGroup(layout.createSequentialGroup()
227 | .addGap(23, 23, 23)
228 | .addComponent(jLabel5))
229 | .addGroup(layout.createSequentialGroup()
230 | .addGap(18, 18, 18)
231 | .addComponent(t6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
232 | .addGap(22, 22, 22)
233 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
234 | .addComponent(jButton2)
235 | .addComponent(t7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
236 | .addGroup(layout.createSequentialGroup()
237 | .addGap(10, 10, 10)
238 | .addComponent(jDesktopPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
239 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
240 | .addComponent(jButton1)
241 | .addGap(76, 76, 76))
242 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
243 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
244 | .addComponent(jLabel9)
245 | .addGap(63, 63, 63))))
246 | );
247 |
248 | pack();
249 | }// //GEN-END:initComponents
250 |
251 | private void t3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_t3ActionPerformed
252 |
253 | }//GEN-LAST:event_t3ActionPerformed
254 |
255 | private void t2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_t2ActionPerformed
256 |
257 | }//GEN-LAST:event_t2ActionPerformed
258 |
259 | private void t4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_t4ActionPerformed
260 |
261 | }//GEN-LAST:event_t4ActionPerformed
262 |
263 | private void t5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_t5ActionPerformed
264 |
265 | }//GEN-LAST:event_t5ActionPerformed
266 |
267 | private void t6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_t6ActionPerformed
268 |
269 | }//GEN-LAST:event_t6ActionPerformed
270 |
271 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
272 | JFileChooser chooser=new JFileChooser();
273 | chooser.showOpenDialog(null);
274 | File f=chooser.getSelectedFile();
275 | jLabel7.setIcon(new ImageIcon(f.toString()));
276 | filename =f.getAbsolutePath();
277 |
278 | t7.setText(filename);
279 | try{
280 |
281 | File image=new File(filename);
282 | FileInputStream fis=new FileInputStream(image);
283 | ByteArrayOutputStream bos=new ByteArrayOutputStream();
284 | byte[] buf=new byte[2024];
285 | for(int n;(n=fis.read(buf))!=-1;)
286 | {
287 | bos.write(buf,0,n);
288 | }
289 | photo=bos.toByteArray();
290 | }catch(Exception e)
291 | {
292 | JOptionPane.showMessageDialog(null,e);
293 | }
294 | }//GEN-LAST:event_jButton2ActionPerformed
295 |
296 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
297 | String sql="insert into child values(?,?,?,?,?,?,?)";
298 | String id=t1.getText();
299 | String name=t2.getText();
300 | String age=t3.getText();
301 | String stand=t4.getText();
302 | String blood=t5.getText();
303 | String health=t6.getText();
304 | try {
305 | if( name.equals("")||blood.equals("")||health.equals("") ||id.equals("")||age.equals("") )
306 | {
307 | jLabel9.setText("please fill all the information");
308 | }
309 | if(id.length()>6)
310 | {
311 | jLabel6.setText("please enter atmost 6 digit");
312 | }
313 |
314 |
315 |
316 | else{
317 | ps=con.prepareStatement(sql);
318 | int idno=(Integer.parseInt(id));
319 | ps.setInt(1,Integer.parseInt(id));
320 | ps.setString(2,name);
321 | ps.setInt(3,Integer.parseInt(age));
322 | ps.setString(4,stand);
323 | ps.setString(5,blood);
324 | ps.setString(6,health);
325 | ps.setBytes(7,photo);
326 | ps.execute();
327 | t1.setText("");
328 | t2.setText("");
329 | t3.setText("");
330 | t4.setText("");
331 | t5.setText("");
332 | t6.setText("");
333 | t7.setText("");
334 | //jLabel7.setText("");
335 | }
336 | } catch (Exception ex) {
337 | //System.out.println(ex);
338 | jLabel6.setText("Please Enter only digits");
339 | }
340 |
341 |
342 | }//GEN-LAST:event_jButton1ActionPerformed
343 |
344 | /**
345 | * @param args the command line arguments
346 | */
347 | public static void main(String args[]) {
348 | /* Set the Nimbus look and feel */
349 | //
350 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
351 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
352 | */
353 | try {
354 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
355 | if ("Nimbus".equals(info.getName())) {
356 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
357 | break;
358 | }
359 | }
360 | } catch (ClassNotFoundException ex) {
361 | java.util.logging.Logger.getLogger(ChildForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
362 | } catch (InstantiationException ex) {
363 | java.util.logging.Logger.getLogger(ChildForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
364 | } catch (IllegalAccessException ex) {
365 | java.util.logging.Logger.getLogger(ChildForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
366 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
367 | java.util.logging.Logger.getLogger(ChildForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
368 | }
369 | //
370 |
371 | /* Create and display the form */
372 | java.awt.EventQueue.invokeLater(new Runnable() {
373 | public void run() {
374 | new ChildForm().setVisible(true);
375 | }
376 | });
377 | }
378 |
379 | // Variables declaration - do not modify//GEN-BEGIN:variables
380 | private javax.swing.JButton jButton1;
381 | private javax.swing.JButton jButton2;
382 | private javax.swing.JDesktopPane jDesktopPane1;
383 | private javax.swing.JLabel jLabel1;
384 | private javax.swing.JLabel jLabel2;
385 | private javax.swing.JLabel jLabel3;
386 | private javax.swing.JLabel jLabel4;
387 | private javax.swing.JLabel jLabel5;
388 | private javax.swing.JLabel jLabel6;
389 | private javax.swing.JLabel jLabel7;
390 | private javax.swing.JLabel jLabel8;
391 | private javax.swing.JLabel jLabel9;
392 | private javax.swing.JTextField t1;
393 | private javax.swing.JTextField t2;
394 | private javax.swing.JTextField t3;
395 | private javax.swing.JTextField t4;
396 | private javax.swing.JTextField t5;
397 | private javax.swing.JTextField t6;
398 | private javax.swing.JTextField t7;
399 | // End of variables declaration//GEN-END:variables
400 | }
401 |
--------------------------------------------------------------------------------