Skip to content

Commit

Permalink
#1 - Added Proper Form With Default Data.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinugawade committed Dec 30, 2021
1 parent e639d18 commit 1b44b3c
Show file tree
Hide file tree
Showing 7 changed files with 907 additions and 27 deletions.
4 changes: 2 additions & 2 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/E:/Pro/Id_Reg/src/Student_Id/Fill_ID_Form.java</file>
<file>file:/E:/Pro/Id_Reg/src/Student_Id/Login_Page.java</file>
<file>file:/E:/Pro/Id_Reg/src/Student_Id/View_Form.java</file>
<file>file:/E:/Pro/Id_Reg/src/Student_Id/Fill_ID_Form.java</file>
<file>file:/E:/Pro/Id_Reg/src/Student_Id/Home.java</file>
<file>file:/E:/Pro/Id_Reg/src/Student_Id/Config_Page.java</file>
</group>
</open-files>
</project-private>
Binary file modified src/Required/JavaDB.db
Binary file not shown.
410 changes: 410 additions & 0 deletions src/Student_Id/Config_Page.form

Large diffs are not rendered by default.

425 changes: 425 additions & 0 deletions src/Student_Id/Config_Page.java

Large diffs are not rendered by default.

27 changes: 23 additions & 4 deletions src/Student_Id/Home.form
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="Home_Button" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="42" max="-2" attributes="0"/>
<Component id="Head_Home" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
<Component id="Config_Page" min="-2" pref="64" max="-2" attributes="0"/>
</Group>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="user" min="-2" max="-2" attributes="0"/>
Expand All @@ -55,7 +57,10 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="Home_Button" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="Config_Page" min="-2" max="-2" attributes="0"/>
<Component id="Home_Button" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
Expand Down Expand Up @@ -162,5 +167,19 @@
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="Home_ButtonMouseClicked"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="Config_Page">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Times New Roman" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Config"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="Config_PageActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
</AuxValues>
</Component>
</SubComponents>
</Form>
66 changes: 46 additions & 20 deletions src/Student_Id/Home.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
package Student_Id;

import java.io.IOException;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;

/*
* @author Vinu_Gawade
*/
public class Home extends javax.swing.JFrame {
public static String User_Loggedin;

public static String User_Loggedin;

public Home(String User_Loggedin) {
initComponents();
setIconImage(new ImageIcon(getClass().getResource("/Img/desktop_logo.png")).getImage());
Home.User_Loggedin= User_Loggedin;
Head_Home.setText(Head_Home.getText()+User_Loggedin);
Home.User_Loggedin = User_Loggedin;
Head_Home.setText(Head_Home.getText() + User_Loggedin);
}

@SuppressWarnings("unchecked")
Expand All @@ -24,6 +31,7 @@ private void initComponents() {
Form_Fill1 = new javax.swing.JButton();
user = new javax.swing.JLabel();
Home_Button = new javax.swing.JLabel();
Config_Page = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Home");
Expand Down Expand Up @@ -80,18 +88,28 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
}
});

Config_Page.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N
Config_Page.setText("Config");
Config_Page.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Config_PageActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(Home_Button)
.addGap(42, 42, 42)
.addComponent(Head_Home, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(Head_Home, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(40, 40, 40)
.addComponent(Config_Page, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(user))
);
Expand All @@ -106,7 +124,9 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
.addComponent(user)))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(Home_Button)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Config_Page)
.addComponent(Home_Button))))
.addGap(18, 18, 18)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(20, Short.MAX_VALUE))
Expand All @@ -116,32 +136,37 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents

public void SetHeading(String User_Loggedin){
System.out.println("Login By "+Head_Home.getText()+User_Loggedin);
Head_Home.setText(Head_Home.getText()+User_Loggedin);
public void SetHeading(String User_Loggedin) {
System.out.println("Login By " + Head_Home.getText() + User_Loggedin);
Head_Home.setText(Head_Home.getText() + User_Loggedin);
}
private void View_IDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_View_IDActionPerformed
this.setVisible(false);
new Fill_ID_Form().setVisible(true);
this.setVisible(false);
new Fill_ID_Form().setVisible(true);

}//GEN-LAST:event_View_IDActionPerformed

private void Form_Fill1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Form_Fill1ActionPerformed
if(View_Form.checkDB()==true){
System.out.println("Nothing Exist in Database...");
JOptionPane.showMessageDialog(null, "Nothing Exist in Database...", "Task Fail", JOptionPane.INFORMATION_MESSAGE);
}else{

if (View_Form.checkDB() == true) {
System.out.println("Nothing Exist in Database...");
JOptionPane.showMessageDialog(null, "Nothing Exist in Database...", "Task Fail", JOptionPane.INFORMATION_MESSAGE);
} else {
this.setVisible(false);
new View_Form().setVisible(true);
}
new View_Form().setVisible(true);
}
}//GEN-LAST:event_Form_Fill1ActionPerformed

private void Home_ButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Home_ButtonMouseClicked
this.setVisible(false);
new Login_Page().setVisible(true);
}//GEN-LAST:event_Home_ButtonMouseClicked

private void Config_PageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Config_PageActionPerformed
this.setVisible(false);
new Config_Page().setVisible(true);
}//GEN-LAST:event_Config_PageActionPerformed

public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
Expand Down Expand Up @@ -173,6 +198,7 @@ public static void main(String args[]) {
}

// Variables declaration - do not modify//GEN-BEGIN:variables
public javax.swing.JButton Config_Page;
public javax.swing.JButton Form_Fill1;
public javax.swing.JLabel Head_Home;
private javax.swing.JLabel Home_Button;
Expand Down
2 changes: 1 addition & 1 deletion src/Student_Id/View_Form.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ private void updateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:
} else {
prestmt.setString(5, dbaddress.getText());
}

int result = prestmt.executeUpdate();
System.out.println("\n Result:" + result);
if (result == 1) {
Expand Down

0 comments on commit 1b44b3c

Please sign in to comment.