├── README.md ├── manifest.mf ├── src ├── img │ ├── reload.png │ ├── supplier.png │ ├── employee (1).png │ ├── google-docs.png │ ├── inventory (1).png │ ├── programmer (1).png │ ├── validating-ticket.png │ └── customer-questions.png ├── report │ └── shopReport.jasper ├── model │ ├── MySQL.java │ ├── invoiceItem.java │ └── GRNItem.java └── gui │ ├── Signin.form │ ├── Signin.java │ ├── CompanyRegistion.form │ ├── Home.form │ ├── AddressView.form │ ├── Home.java │ ├── CompanyRegistion.java │ ├── AddressView.java │ ├── empolyee_register.form │ ├── suppllerRegister.form │ ├── customer_register.form │ └── customer_register.java ├── lib ├── flatlaf-3.1.1.jar ├── commons-digester-2.1.jar ├── commons-logging-1.2.jar ├── jasperreports-6.20.5.jar ├── commons-beanutils-1.9.4.jar ├── jcalnder │ └── jcalendar-1.4.jar ├── commons-collections-3.2.2.jar ├── commons-collections4-4.4.jar ├── mysql-connector-java-8.0.24.jar ├── flatlaf-intellij-themes-3.1.1.jar ├── CopyLibs │ └── org-netbeans-modules-java-j2seproject-copylibstask.jar └── nblibraries.properties └── nbproject ├── private ├── private.properties └── private.xml ├── genfiles.properties ├── project.xml └── project.properties /README.md: -------------------------------------------------------------------------------- 1 | # possystem 2 | java pos system 3 | -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /src/img/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/reload.png -------------------------------------------------------------------------------- /lib/flatlaf-3.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/flatlaf-3.1.1.jar -------------------------------------------------------------------------------- /src/img/supplier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/supplier.png -------------------------------------------------------------------------------- /src/img/employee (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/employee (1).png -------------------------------------------------------------------------------- /src/img/google-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/google-docs.png -------------------------------------------------------------------------------- /src/img/inventory (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/inventory (1).png -------------------------------------------------------------------------------- /src/img/programmer (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/programmer (1).png -------------------------------------------------------------------------------- /lib/commons-digester-2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/commons-digester-2.1.jar -------------------------------------------------------------------------------- /lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /lib/jasperreports-6.20.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/jasperreports-6.20.5.jar -------------------------------------------------------------------------------- /src/img/validating-ticket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/validating-ticket.png -------------------------------------------------------------------------------- /src/report/shopReport.jasper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/report/shopReport.jasper -------------------------------------------------------------------------------- /lib/commons-beanutils-1.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/commons-beanutils-1.9.4.jar -------------------------------------------------------------------------------- /lib/jcalnder/jcalendar-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/jcalnder/jcalendar-1.4.jar -------------------------------------------------------------------------------- /src/img/customer-questions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/src/img/customer-questions.png -------------------------------------------------------------------------------- /lib/commons-collections-3.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/commons-collections-3.2.2.jar -------------------------------------------------------------------------------- /lib/commons-collections4-4.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/commons-collections4-4.4.jar -------------------------------------------------------------------------------- /lib/mysql-connector-java-8.0.24.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/mysql-connector-java-8.0.24.jar -------------------------------------------------------------------------------- /lib/flatlaf-intellij-themes-3.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/flatlaf-intellij-themes-3.1.1.jar -------------------------------------------------------------------------------- /nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\user\\AppData\\Roaming\\NetBeans\\15\\build.properties 3 | -------------------------------------------------------------------------------- /lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IshanNikeshalaNawarathna/possystem/HEAD/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar -------------------------------------------------------------------------------- /lib/nblibraries.properties: -------------------------------------------------------------------------------- 1 | libs.CopyLibs.classpath=\ 2 | ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar 3 | libs.CopyLibs.displayName=CopyLibs Task 4 | libs.CopyLibs.prop-version=3.0 5 | libs.jcalnder.classpath=\ 6 | ${base}/jcalnder/jcalendar-1.4.jar 7 | libs.jcalnder.displayName=jcalendar 8 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=6bceaa04 2 | build.xml.script.CRC32=d5798013 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.104.0.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=6bceaa04 7 | nbproject/build-impl.xml.script.CRC32=5ad791d2 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.104.0.48 9 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | shop_app 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | .\lib\nblibraries.properties 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/C:/Users/user/Documents/NetBeansProjects/shop_app/src/gui/CompanyRegistion.java 7 | file:/C:/Users/user/Documents/NetBeansProjects/shop_app/src/gui/Home.java 8 | file:/C:/Users/user/Documents/NetBeansProjects/shop_app/src/gui/Signin.java 9 | file:/C:/Users/user/Documents/NetBeansProjects/shop_app/src/gui/suppllerRegister.java 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/model/MySQL.java: -------------------------------------------------------------------------------- 1 | package model; 2 | 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.ResultSet; 6 | 7 | public class MySQL { 8 | 9 | private static Connection connection; 10 | 11 | static { 12 | try { 13 | Class.forName("com.mysql.cj.jdbc.Driver"); 14 | connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/shop_db", "root", "Ishan9952@*v$"); 15 | 16 | } catch (Exception e) { 17 | e.printStackTrace(); 18 | } 19 | 20 | } 21 | 22 | public static ResultSet execute(String query) throws Exception { 23 | 24 | if (query.startsWith("SELECT")) { 25 | return connection.createStatement().executeQuery(query); 26 | } else { 27 | connection.createStatement().executeUpdate(query); 28 | return null; 29 | } 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/model/invoiceItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template 4 | */ 5 | package model; 6 | 7 | 8 | 9 | /** 10 | * 11 | * @author user 12 | */ 13 | public class invoiceItem { 14 | 15 | private String stockID; 16 | private String brandName; 17 | private String productName; 18 | private String mfg; 19 | private String exp; 20 | private String qty; 21 | private String sellingPrice; 22 | 23 | public String getStockID() { 24 | return stockID; 25 | } 26 | 27 | public void setStockID(String stockID) { 28 | this.stockID = stockID; 29 | } 30 | 31 | public String getBrandName() { 32 | return brandName; 33 | } 34 | 35 | public void setBrandName(String brandName) { 36 | this.brandName = brandName; 37 | } 38 | 39 | public String getProductName() { 40 | return productName; 41 | } 42 | 43 | public void setProductName(String productName) { 44 | this.productName = productName; 45 | } 46 | 47 | public String getQty() { 48 | return qty; 49 | } 50 | 51 | public void setQty(String qty) { 52 | this.qty = qty; 53 | } 54 | 55 | public String getSellingPrice() { 56 | return sellingPrice; 57 | } 58 | 59 | public void setSellingPrice(String sellingPrice) { 60 | this.sellingPrice = sellingPrice; 61 | } 62 | 63 | public String getMfg() { 64 | return mfg; 65 | } 66 | 67 | public void setMfg(String mfg) { 68 | this.mfg = mfg; 69 | } 70 | 71 | public String getExp() { 72 | return exp; 73 | } 74 | 75 | public void setExp(String exp) { 76 | this.exp = exp; 77 | } 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/model/GRNItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template 4 | */ 5 | package model; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * 11 | * @author user 12 | */ 13 | public class GRNItem { 14 | 15 | private String productId; 16 | private String brandName; 17 | private String productName; 18 | private double qty; 19 | private double buyingPrice; 20 | private double sellingPrice; 21 | private Date mfg; 22 | private Date exp; 23 | 24 | public String getProductId() { 25 | return productId; 26 | } 27 | 28 | public void setProductId(String productId) { 29 | this.productId = productId; 30 | } 31 | 32 | public String getBrandName() { 33 | return brandName; 34 | } 35 | 36 | public void setBrandName(String brandName) { 37 | this.brandName = brandName; 38 | } 39 | 40 | public String getProductName() { 41 | return productName; 42 | } 43 | 44 | public void setProductName(String productName) { 45 | this.productName = productName; 46 | } 47 | 48 | public double getQty() { 49 | return qty; 50 | } 51 | 52 | public void setQty(double qty) { 53 | this.qty = qty; 54 | } 55 | 56 | public double getBuyingPrice() { 57 | return buyingPrice; 58 | } 59 | 60 | public void setBuyingPrice(double buyingPrice) { 61 | this.buyingPrice = buyingPrice; 62 | } 63 | 64 | public double getSellingPrice() { 65 | return sellingPrice; 66 | } 67 | 68 | public void setSellingPrice(double sellingPrice) { 69 | this.sellingPrice = sellingPrice; 70 | } 71 | 72 | public Date getMfg() { 73 | return mfg; 74 | } 75 | 76 | public void setMfg(Date mfg) { 77 | this.mfg = mfg; 78 | } 79 | 80 | public Date getExp() { 81 | return exp; 82 | } 83 | 84 | public void setExp(Date exp) { 85 | this.exp = exp; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.modulepath=\ 22 | ${run.modulepath} 23 | debug.test.classpath=\ 24 | ${run.test.classpath} 25 | debug.test.modulepath=\ 26 | ${run.test.modulepath} 27 | # Files in build.classes.dir which should be excluded from distribution jar 28 | dist.archive.excludes= 29 | # This directory is removed when the project is cleaned: 30 | dist.dir=dist 31 | dist.jar=${dist.dir}/shop_app.jar 32 | dist.javadoc.dir=${dist.dir}/javadoc 33 | dist.jlink.dir=${dist.dir}/jlink 34 | dist.jlink.output=${dist.jlink.dir}/shop_app 35 | excludes= 36 | file.reference.commons-beanutils-1.9.4.jar=lib\\commons-beanutils-1.9.4.jar 37 | file.reference.commons-collections-3.2.2.jar=lib\\commons-collections-3.2.2.jar 38 | file.reference.commons-collections4-4.4.jar=lib\\commons-collections4-4.4.jar 39 | file.reference.commons-digester-2.1.jar=lib\\commons-digester-2.1.jar 40 | file.reference.commons-logging-1.2.jar=lib\\commons-logging-1.2.jar 41 | file.reference.flatlaf-3.1.1.jar=lib\\flatlaf-3.1.1.jar 42 | file.reference.flatlaf-intellij-themes-3.1.1.jar=lib\\flatlaf-intellij-themes-3.1.1.jar 43 | file.reference.jasperreports-6.20.5.jar=lib\\jasperreports-6.20.5.jar 44 | file.reference.mysql-connector-java-8.0.24.jar=lib\\mysql-connector-java-8.0.24.jar 45 | includes=** 46 | jar.compress=false 47 | javac.classpath=\ 48 | ${file.reference.mysql-connector-java-8.0.24.jar}:\ 49 | ${file.reference.flatlaf-3.1.1.jar}:\ 50 | ${file.reference.flatlaf-intellij-themes-3.1.1.jar}:\ 51 | ${file.reference.jasperreports-6.20.5.jar}:\ 52 | ${libs.jcalnder.classpath}:\ 53 | ${file.reference.commons-beanutils-1.9.4.jar}:\ 54 | ${file.reference.commons-collections-3.2.2.jar}:\ 55 | ${file.reference.commons-collections4-4.4.jar}:\ 56 | ${file.reference.commons-digester-2.1.jar}:\ 57 | ${file.reference.commons-logging-1.2.jar} 58 | # Space-separated list of extra javac options 59 | javac.compilerargs= 60 | javac.deprecation=false 61 | javac.external.vm=true 62 | javac.modulepath= 63 | javac.processormodulepath= 64 | javac.processorpath=\ 65 | ${javac.classpath} 66 | javac.source=1.8 67 | javac.target=1.8 68 | javac.test.classpath=\ 69 | ${javac.classpath}:\ 70 | ${build.classes.dir} 71 | javac.test.modulepath=\ 72 | ${javac.modulepath} 73 | javac.test.processorpath=\ 74 | ${javac.test.classpath} 75 | javadoc.additionalparam= 76 | javadoc.author=false 77 | javadoc.encoding=${source.encoding} 78 | javadoc.html5=false 79 | javadoc.noindex=false 80 | javadoc.nonavbar=false 81 | javadoc.notree=false 82 | javadoc.private=false 83 | javadoc.splitindex=true 84 | javadoc.use=true 85 | javadoc.version=false 86 | javadoc.windowtitle= 87 | # The jlink additional root modules to resolve 88 | jlink.additionalmodules= 89 | # The jlink additional command line parameters 90 | jlink.additionalparam= 91 | jlink.launcher=true 92 | jlink.launcher.name=shop_app 93 | main.class= 94 | manifest.file=manifest.mf 95 | meta.inf.dir=${src.dir}/META-INF 96 | mkdist.disabled=false 97 | platform.active=default_platform 98 | run.classpath=\ 99 | ${javac.classpath}:\ 100 | ${build.classes.dir} 101 | # Space-separated list of JVM arguments used when running the project. 102 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 103 | # To set system properties for unit tests define test-sys-prop.name=value: 104 | run.jvmargs= 105 | run.modulepath=\ 106 | ${javac.modulepath} 107 | run.test.classpath=\ 108 | ${javac.test.classpath}:\ 109 | ${build.test.classes.dir} 110 | run.test.modulepath=\ 111 | ${javac.test.modulepath} 112 | source.encoding=UTF-8 113 | src.dir=src 114 | test.src.dir=test 115 | -------------------------------------------------------------------------------- /src/gui/Signin.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /src/gui/Signin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template 4 | */ 5 | package gui; 6 | 7 | import com.formdev.flatlaf.themes.FlatMacDarkLaf; 8 | import java.sql.ResultSet; 9 | import javax.swing.JButton; 10 | import javax.swing.JOptionPane; 11 | import model.MySQL; 12 | 13 | /** 14 | * 15 | * @author user 16 | */ 17 | public class Signin extends javax.swing.JFrame { 18 | 19 | private static String newType; 20 | 21 | private static String employeeEmail; 22 | 23 | public static String getEmployeeEmail() { 24 | return employeeEmail; 25 | } 26 | 27 | private static void setEmployeeEmail(String employeeEmail) { 28 | Signin.employeeEmail = employeeEmail; 29 | } 30 | 31 | public static String getNewType() { 32 | return newType; 33 | } 34 | 35 | public static void setNewType(String aNewType) { 36 | newType = aNewType; 37 | } 38 | 39 | public Signin() { 40 | initComponents(); 41 | } 42 | 43 | /** 44 | * This method is called from within the constructor to initialize the form. 45 | * WARNING: Do NOT modify this code. The content of this method is always 46 | * regenerated by the Form Editor. 47 | */ 48 | @SuppressWarnings("unchecked") 49 | // //GEN-BEGIN:initComponents 50 | private void initComponents() { 51 | 52 | jPanel1 = new javax.swing.JPanel(); 53 | jLabel1 = new javax.swing.JLabel(); 54 | jLabel2 = new javax.swing.JLabel(); 55 | jLabel3 = new javax.swing.JLabel(); 56 | jTextField1 = new javax.swing.JTextField(); 57 | jPasswordField1 = new javax.swing.JPasswordField(); 58 | jButton1 = new javax.swing.JButton(); 59 | 60 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 61 | 62 | jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N 63 | jLabel1.setText("SIGN IN"); 64 | 65 | jLabel2.setText("Pasword"); 66 | 67 | jLabel3.setText("Email"); 68 | 69 | jPasswordField1.addActionListener(new java.awt.event.ActionListener() { 70 | public void actionPerformed(java.awt.event.ActionEvent evt) { 71 | jPasswordField1ActionPerformed(evt); 72 | } 73 | }); 74 | 75 | jButton1.setFont(new java.awt.Font("Segoe UI", 1, 12)); // NOI18N 76 | jButton1.setText("Sign In"); 77 | jButton1.addActionListener(new java.awt.event.ActionListener() { 78 | public void actionPerformed(java.awt.event.ActionEvent evt) { 79 | jButton1ActionPerformed(evt); 80 | } 81 | }); 82 | 83 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 84 | jPanel1.setLayout(jPanel1Layout); 85 | jPanel1Layout.setHorizontalGroup( 86 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 87 | .addGroup(jPanel1Layout.createSequentialGroup() 88 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 89 | .addGroup(jPanel1Layout.createSequentialGroup() 90 | .addGap(60, 60, 60) 91 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 92 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE) 93 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 94 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE) 95 | .addComponent(jTextField1) 96 | .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)))) 97 | .addGroup(jPanel1Layout.createSequentialGroup() 98 | .addGap(24, 24, 24) 99 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)) 100 | .addGroup(jPanel1Layout.createSequentialGroup() 101 | .addGap(110, 110, 110) 102 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE))) 103 | .addContainerGap(60, Short.MAX_VALUE)) 104 | ); 105 | jPanel1Layout.setVerticalGroup( 106 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 107 | .addGroup(jPanel1Layout.createSequentialGroup() 108 | .addContainerGap() 109 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 110 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 111 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 112 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 113 | .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 114 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 115 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 116 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 117 | .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 118 | .addGap(20, 20, 20) 119 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) 120 | .addContainerGap(21, Short.MAX_VALUE)) 121 | ); 122 | 123 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 124 | getContentPane().setLayout(layout); 125 | layout.setHorizontalGroup( 126 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 127 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 128 | ); 129 | layout.setVerticalGroup( 130 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 131 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 132 | ); 133 | 134 | pack(); 135 | setLocationRelativeTo(null); 136 | }// //GEN-END:initComponents 137 | 138 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 139 | // TODO add your handling code here: 140 | 141 | String email = jTextField1.getText(); 142 | String password = String.valueOf(jPasswordField1.getPassword()); 143 | 144 | if (email.isEmpty()) { 145 | JOptionPane.showMessageDialog(this, "Please Enter Email Address", "warning", JOptionPane.INFORMATION_MESSAGE); 146 | } else if (!email.matches("^(?=.{1,64}@)[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*@" 147 | + "[^-][A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$")) { 148 | JOptionPane.showMessageDialog(this, "Invalid Email Address", "warning", JOptionPane.INFORMATION_MESSAGE); 149 | } else if (password.isEmpty()) { 150 | JOptionPane.showMessageDialog(this, "Please Enter Password", "warning", JOptionPane.INFORMATION_MESSAGE); 151 | } else { 152 | 153 | try { 154 | 155 | ResultSet resultset = MySQL.execute("SELECT * FROM `employee` INNER JOIN `employee_type` ON `employee`.`employee_type_id`=`employee_type`.`id` WHERE `email`='" + email + "' AND `password`='" + password + "'"); 156 | 157 | if (resultset.next()) { 158 | 159 | String fname = resultset.getString("first_name"); 160 | String lname = resultset.getString("last_name"); 161 | String ty = resultset.getString("employee_type.name"); 162 | setEmployeeEmail(email); 163 | setNewType(ty); 164 | Home home = new Home(email, fname, lname); 165 | home.setVisible(true); 166 | this.dispose(); 167 | 168 | } else { 169 | JOptionPane.showMessageDialog(this, "Invalid Detalis", "warning", JOptionPane.INFORMATION_MESSAGE); 170 | } 171 | 172 | } catch (Exception e) { 173 | e.printStackTrace(); 174 | } 175 | 176 | } 177 | 178 | }//GEN-LAST:event_jButton1ActionPerformed 179 | 180 | private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordField1ActionPerformed 181 | // TODO add your handling code here: 182 | }//GEN-LAST:event_jPasswordField1ActionPerformed 183 | 184 | /** 185 | * @param args the command line arguments 186 | */ 187 | public static void main(String args[]) { 188 | 189 | FlatMacDarkLaf.setup(); 190 | 191 | java.awt.EventQueue.invokeLater(new Runnable() { 192 | public void run() { 193 | new Signin().setVisible(true); 194 | } 195 | }); 196 | } 197 | 198 | // Variables declaration - do not modify//GEN-BEGIN:variables 199 | private javax.swing.JButton jButton1; 200 | private javax.swing.JLabel jLabel1; 201 | private javax.swing.JLabel jLabel2; 202 | private javax.swing.JLabel jLabel3; 203 | private javax.swing.JPanel jPanel1; 204 | private javax.swing.JPasswordField jPasswordField1; 205 | private javax.swing.JTextField jTextField1; 206 | // End of variables declaration//GEN-END:variables 207 | 208 | } 209 | -------------------------------------------------------------------------------- /src/gui/CompanyRegistion.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 |
110 |
111 | 112 | 113 | 114 | 115 | <Editor/> 116 | <Renderer/> 117 | </Column> 118 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 119 | <Title/> 120 | <Editor/> 121 | <Renderer/> 122 | </Column> 123 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 124 | <Title/> 125 | <Editor/> 126 | <Renderer/> 127 | </Column> 128 | </TableColumnModel> 129 | </Property> 130 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 131 | <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 132 | </Property> 133 | </Properties> 134 | <Events> 135 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTable1MouseClicked"/> 136 | </Events> 137 | </Component> 138 | </SubComponents> 139 | </Container> 140 | <Component class="javax.swing.JLabel" name="jLabel1"> 141 | <Properties> 142 | <Property name="text" type="java.lang.String" value="Name"/> 143 | </Properties> 144 | </Component> 145 | <Component class="javax.swing.JTextField" name="jTextField2"> 146 | </Component> 147 | <Component class="javax.swing.JLabel" name="jLabel2"> 148 | <Properties> 149 | <Property name="text" type="java.lang.String" value="Hotline"/> 150 | <Property name="toolTipText" type="java.lang.String" value=""/> 151 | </Properties> 152 | </Component> 153 | <Component class="javax.swing.JTextField" name="jTextField3"> 154 | </Component> 155 | <Component class="javax.swing.JButton" name="jButton1"> 156 | <Properties> 157 | <Property name="text" type="java.lang.String" value="Add"/> 158 | </Properties> 159 | <Events> 160 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> 161 | </Events> 162 | </Component> 163 | <Component class="javax.swing.JButton" name="jButton2"> 164 | <Properties> 165 | <Property name="text" type="java.lang.String" value="Update"/> 166 | </Properties> 167 | <Events> 168 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> 169 | </Events> 170 | </Component> 171 | <Component class="javax.swing.JButton" name="jButton3"> 172 | <Events> 173 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> 174 | </Events> 175 | </Component> 176 | </SubComponents> 177 | </Container> 178 | </SubComponents> 179 | </Form> 180 | -------------------------------------------------------------------------------- /src/gui/Home.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="3"/> 6 | </Properties> 7 | <SyntheticProperties> 8 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 9 | <SyntheticProperty name="generateCenter" type="boolean" value="true"/> 10 | </SyntheticProperties> 11 | <AuxValues> 12 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 13 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 14 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 15 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 17 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 18 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 19 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 20 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 21 | </AuxValues> 22 | 23 | <Layout> 24 | <DimensionLayout dim="0"> 25 | <Group type="103" groupAlignment="0" attributes="0"> 26 | <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> 27 | </Group> 28 | </DimensionLayout> 29 | <DimensionLayout dim="1"> 30 | <Group type="103" groupAlignment="0" attributes="0"> 31 | <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> 32 | </Group> 33 | </DimensionLayout> 34 | </Layout> 35 | <SubComponents> 36 | <Container class="javax.swing.JPanel" name="jPanel1"> 37 | 38 | <Layout> 39 | <DimensionLayout dim="0"> 40 | <Group type="103" groupAlignment="0" attributes="0"> 41 | <Group type="102" alignment="0" attributes="0"> 42 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 43 | <Component id="jButton1" min="-2" max="-2" attributes="0"/> 44 | <EmptySpace type="unrelated" max="-2" attributes="0"/> 45 | <Component id="jButton2" min="-2" max="-2" attributes="0"/> 46 | <EmptySpace max="-2" attributes="0"/> 47 | <Group type="103" groupAlignment="0" attributes="0"> 48 | <Component id="jLabel5" alignment="1" min="-2" pref="74" max="-2" attributes="0"/> 49 | <Group type="102" alignment="1" attributes="0"> 50 | <Component id="jButton3" min="-2" max="-2" attributes="0"/> 51 | <EmptySpace max="-2" attributes="0"/> 52 | <Component id="jButton4" min="-2" max="-2" attributes="0"/> 53 | </Group> 54 | </Group> 55 | <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> 56 | <Group type="103" groupAlignment="0" attributes="0"> 57 | <Group type="102" attributes="0"> 58 | <Component id="jButton5" min="-2" max="-2" attributes="0"/> 59 | <EmptySpace max="-2" attributes="0"/> 60 | <Component id="jButton6" min="-2" max="-2" attributes="0"/> 61 | </Group> 62 | <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> 63 | <Group type="102" attributes="0"> 64 | <Component id="jLabel3" min="-2" max="-2" attributes="0"/> 65 | <EmptySpace max="-2" attributes="0"/> 66 | <Component id="jLabel4" max="32767" attributes="0"/> 67 | </Group> 68 | <Group type="102" alignment="0" attributes="0"> 69 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 70 | <EmptySpace max="-2" attributes="0"/> 71 | <Component id="jLabel2" min="-2" pref="165" max="-2" attributes="0"/> 72 | </Group> 73 | </Group> 74 | </Group> 75 | <EmptySpace pref="12" max="32767" attributes="0"/> 76 | </Group> 77 | </Group> 78 | </DimensionLayout> 79 | <DimensionLayout dim="1"> 80 | <Group type="103" groupAlignment="0" attributes="0"> 81 | <Group type="102" alignment="0" attributes="0"> 82 | <EmptySpace max="-2" attributes="0"/> 83 | <Group type="103" groupAlignment="0" attributes="0"> 84 | <Group type="102" attributes="0"> 85 | <Group type="103" groupAlignment="3" attributes="0"> 86 | <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> 87 | <Component id="jLabel2" alignment="3" min="-2" pref="28" max="-2" attributes="0"/> 88 | </Group> 89 | <EmptySpace max="-2" attributes="0"/> 90 | <Group type="103" groupAlignment="3" attributes="0"> 91 | <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> 92 | <Component id="jLabel4" alignment="3" min="-2" pref="32" max="-2" attributes="0"/> 93 | </Group> 94 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 95 | </Group> 96 | <Group type="102" alignment="1" attributes="0"> 97 | <Component id="jLabel5" min="-2" pref="66" max="-2" attributes="0"/> 98 | <EmptySpace max="-2" attributes="0"/> 99 | </Group> 100 | </Group> 101 | <Group type="103" groupAlignment="3" attributes="0"> 102 | <Component id="jButton1" alignment="3" min="-2" pref="46" max="-2" attributes="0"/> 103 | <Component id="jButton2" alignment="3" min="-2" pref="46" max="-2" attributes="0"/> 104 | <Component id="jButton3" alignment="3" min="-2" pref="46" max="-2" attributes="0"/> 105 | <Component id="jButton4" alignment="3" min="-2" pref="46" max="-2" attributes="0"/> 106 | <Component id="jButton5" alignment="3" min="-2" pref="46" max="-2" attributes="0"/> 107 | <Component id="jButton6" alignment="3" min="-2" pref="46" max="-2" attributes="0"/> 108 | </Group> 109 | <EmptySpace pref="10" max="32767" attributes="0"/> 110 | </Group> 111 | </Group> 112 | </DimensionLayout> 113 | </Layout> 114 | <SubComponents> 115 | <Component class="javax.swing.JLabel" name="jLabel1"> 116 | <Properties> 117 | <Property name="text" type="java.lang.String" value="Name"/> 118 | </Properties> 119 | </Component> 120 | <Component class="javax.swing.JLabel" name="jLabel2"> 121 | <Properties> 122 | <Property name="text" type="java.lang.String" value="None"/> 123 | </Properties> 124 | </Component> 125 | <Component class="javax.swing.JLabel" name="jLabel3"> 126 | <Properties> 127 | <Property name="text" type="java.lang.String" value="Email"/> 128 | </Properties> 129 | </Component> 130 | <Component class="javax.swing.JLabel" name="jLabel4"> 131 | <Properties> 132 | <Property name="text" type="java.lang.String" value="None"/> 133 | </Properties> 134 | </Component> 135 | <Component class="javax.swing.JButton" name="jButton1"> 136 | <Properties> 137 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 138 | <Image iconType="3" name="/img/customer-questions.png"/> 139 | </Property> 140 | <Property name="text" type="java.lang.String" value="Customer Registation"/> 141 | </Properties> 142 | <Events> 143 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> 144 | </Events> 145 | </Component> 146 | <Component class="javax.swing.JButton" name="jButton2"> 147 | <Properties> 148 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 149 | <Image iconType="3" name="/img/supplier.png"/> 150 | </Property> 151 | <Property name="text" type="java.lang.String" value="Supplier Registation"/> 152 | </Properties> 153 | <Events> 154 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> 155 | </Events> 156 | </Component> 157 | <Component class="javax.swing.JButton" name="jButton3"> 158 | <Properties> 159 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 160 | <Image iconType="3" name="/img/employee (1).png"/> 161 | </Property> 162 | <Property name="text" type="java.lang.String" value="Employee Registation "/> 163 | </Properties> 164 | <Events> 165 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> 166 | </Events> 167 | </Component> 168 | <Component class="javax.swing.JButton" name="jButton4"> 169 | <Properties> 170 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 171 | <Image iconType="3" name="/img/google-docs.png"/> 172 | </Property> 173 | <Property name="text" type="java.lang.String" value="GRN"/> 174 | </Properties> 175 | <Events> 176 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/> 177 | </Events> 178 | </Component> 179 | <Component class="javax.swing.JButton" name="jButton5"> 180 | <Properties> 181 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 182 | <Image iconType="3" name="/img/validating-ticket.png"/> 183 | </Property> 184 | <Property name="text" type="java.lang.String" value="Invoice"/> 185 | </Properties> 186 | <Events> 187 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton5ActionPerformed"/> 188 | </Events> 189 | </Component> 190 | <Component class="javax.swing.JButton" name="jButton6"> 191 | <Properties> 192 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 193 | <Image iconType="3" name="/img/inventory (1).png"/> 194 | </Property> 195 | <Property name="text" type="java.lang.String" value="Stock"/> 196 | </Properties> 197 | <Events> 198 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton6ActionPerformed"/> 199 | </Events> 200 | </Component> 201 | <Component class="javax.swing.JLabel" name="jLabel5"> 202 | <Properties> 203 | <Property name="horizontalAlignment" type="int" value="0"/> 204 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 205 | <Image iconType="3" name="/img/programmer (1).png"/> 206 | </Property> 207 | </Properties> 208 | </Component> 209 | </SubComponents> 210 | </Container> 211 | </SubComponents> 212 | </Form> 213 | -------------------------------------------------------------------------------- /src/gui/AddressView.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="2"/> 6 | </Properties> 7 | <SyntheticProperties> 8 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 9 | <SyntheticProperty name="generateCenter" type="boolean" value="true"/> 10 | </SyntheticProperties> 11 | <AuxValues> 12 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 13 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 14 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 15 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 17 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 18 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 19 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 20 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 21 | </AuxValues> 22 | 23 | <Layout> 24 | <DimensionLayout dim="0"> 25 | <Group type="103" groupAlignment="0" attributes="0"> 26 | <Group type="102" alignment="0" attributes="0"> 27 | <EmptySpace max="-2" attributes="0"/> 28 | <Component id="jPanel1" max="32767" attributes="0"/> 29 | <EmptySpace max="-2" attributes="0"/> 30 | </Group> 31 | </Group> 32 | </DimensionLayout> 33 | <DimensionLayout dim="1"> 34 | <Group type="103" groupAlignment="0" attributes="0"> 35 | <Group type="102" alignment="0" attributes="0"> 36 | <Component id="jPanel1" min="-2" max="-2" attributes="0"/> 37 | <EmptySpace min="0" pref="10" max="32767" attributes="0"/> 38 | </Group> 39 | </Group> 40 | </DimensionLayout> 41 | </Layout> 42 | <SubComponents> 43 | <Container class="javax.swing.JPanel" name="jPanel1"> 44 | 45 | <Layout> 46 | <DimensionLayout dim="0"> 47 | <Group type="103" groupAlignment="0" attributes="0"> 48 | <Group type="102" alignment="1" attributes="0"> 49 | <Group type="103" groupAlignment="1" attributes="0"> 50 | <Group type="102" attributes="0"> 51 | <EmptySpace max="-2" attributes="0"/> 52 | <Component id="jButton1" min="-2" pref="100" max="-2" attributes="0"/> 53 | <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> 54 | <Component id="jButton2" min="-2" pref="100" max="-2" attributes="0"/> 55 | <EmptySpace pref="28" max="32767" attributes="0"/> 56 | <Component id="jButton3" min="-2" pref="100" max="-2" attributes="0"/> 57 | </Group> 58 | <Group type="102" alignment="0" attributes="0"> 59 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 60 | <Group type="103" groupAlignment="0" attributes="0"> 61 | <Group type="102" attributes="0"> 62 | <Component id="jLabel3" min="-2" pref="73" max="-2" attributes="0"/> 63 | <EmptySpace max="-2" attributes="0"/> 64 | <Component id="jComboBox1" max="32767" attributes="0"/> 65 | </Group> 66 | <Group type="102" alignment="0" attributes="0"> 67 | <Component id="jLabel2" min="-2" pref="73" max="-2" attributes="0"/> 68 | <EmptySpace max="-2" attributes="0"/> 69 | <Component id="jTextField1" max="32767" attributes="0"/> 70 | </Group> 71 | <Group type="102" alignment="0" attributes="0"> 72 | <Group type="103" groupAlignment="0" attributes="0"> 73 | <Component id="jLabel1" alignment="0" min="-2" pref="73" max="-2" attributes="0"/> 74 | <Component id="jLabel4" alignment="0" min="-2" pref="65" max="-2" attributes="0"/> 75 | </Group> 76 | <EmptySpace max="-2" attributes="0"/> 77 | <Group type="103" groupAlignment="0" attributes="0"> 78 | <Component id="emailFiled" max="32767" attributes="0"/> 79 | <Component id="jTextField2" max="32767" attributes="0"/> 80 | </Group> 81 | </Group> 82 | </Group> 83 | </Group> 84 | </Group> 85 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 86 | </Group> 87 | <Group type="102" alignment="0" attributes="0"> 88 | <EmptySpace max="-2" attributes="0"/> 89 | <Component id="jScrollPane1" min="-2" pref="353" max="-2" attributes="0"/> 90 | <EmptySpace max="32767" attributes="0"/> 91 | </Group> 92 | </Group> 93 | </DimensionLayout> 94 | <DimensionLayout dim="1"> 95 | <Group type="103" groupAlignment="0" attributes="0"> 96 | <Group type="102" attributes="0"> 97 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 98 | <Group type="103" groupAlignment="3" attributes="0"> 99 | <Component id="jLabel4" alignment="3" min="-2" pref="34" max="-2" attributes="0"/> 100 | <Component id="emailFiled" alignment="3" min="-2" pref="34" max="-2" attributes="0"/> 101 | </Group> 102 | <EmptySpace max="-2" attributes="0"/> 103 | <Group type="103" groupAlignment="3" attributes="0"> 104 | <Component id="jLabel1" alignment="3" min="-2" pref="33" max="-2" attributes="0"/> 105 | <Component id="jTextField2" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 106 | </Group> 107 | <EmptySpace max="-2" attributes="0"/> 108 | <Group type="103" groupAlignment="3" attributes="0"> 109 | <Component id="jLabel2" alignment="3" min="-2" pref="33" max="-2" attributes="0"/> 110 | <Component id="jTextField1" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 111 | </Group> 112 | <EmptySpace max="-2" attributes="0"/> 113 | <Group type="103" groupAlignment="3" attributes="0"> 114 | <Component id="jLabel3" alignment="3" min="-2" pref="33" max="-2" attributes="0"/> 115 | <Component id="jComboBox1" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 116 | </Group> 117 | <EmptySpace max="-2" attributes="0"/> 118 | <Group type="103" groupAlignment="0" attributes="0"> 119 | <Component id="jButton2" alignment="1" min="-2" pref="30" max="-2" attributes="0"/> 120 | <Group type="103" groupAlignment="3" attributes="0"> 121 | <Component id="jButton1" alignment="3" min="-2" pref="30" max="-2" attributes="0"/> 122 | <Component id="jButton3" alignment="3" min="-2" pref="30" max="-2" attributes="0"/> 123 | </Group> 124 | </Group> 125 | <EmptySpace max="-2" attributes="0"/> 126 | <Component id="jScrollPane1" min="-2" pref="140" max="-2" attributes="0"/> 127 | <EmptySpace max="-2" attributes="0"/> 128 | </Group> 129 | </Group> 130 | </DimensionLayout> 131 | </Layout> 132 | <SubComponents> 133 | <Component class="javax.swing.JLabel" name="jLabel1"> 134 | <Properties> 135 | <Property name="text" type="java.lang.String" value="Address Line1"/> 136 | </Properties> 137 | </Component> 138 | <Component class="javax.swing.JLabel" name="jLabel2"> 139 | <Properties> 140 | <Property name="text" type="java.lang.String" value="Address Line2"/> 141 | </Properties> 142 | </Component> 143 | <Component class="javax.swing.JLabel" name="jLabel3"> 144 | <Properties> 145 | <Property name="text" type="java.lang.String" value="City"/> 146 | </Properties> 147 | </Component> 148 | <Component class="javax.swing.JTextField" name="jTextField1"> 149 | </Component> 150 | <Component class="javax.swing.JTextField" name="jTextField2"> 151 | </Component> 152 | <Component class="javax.swing.JComboBox" name="jComboBox1"> 153 | <Properties> 154 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 155 | <StringArray count="4"> 156 | <StringItem index="0" value="Item 1"/> 157 | <StringItem index="1" value="Item 2"/> 158 | <StringItem index="2" value="Item 3"/> 159 | <StringItem index="3" value="Item 4"/> 160 | </StringArray> 161 | </Property> 162 | </Properties> 163 | <AuxValues> 164 | <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 165 | </AuxValues> 166 | </Component> 167 | <Component class="javax.swing.JButton" name="jButton1"> 168 | <Properties> 169 | <Property name="text" type="java.lang.String" value="Add"/> 170 | </Properties> 171 | <Events> 172 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> 173 | </Events> 174 | </Component> 175 | <Component class="javax.swing.JButton" name="jButton2"> 176 | <Properties> 177 | <Property name="text" type="java.lang.String" value="Update"/> 178 | </Properties> 179 | <Events> 180 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> 181 | </Events> 182 | </Component> 183 | <Component class="javax.swing.JButton" name="jButton3"> 184 | <Properties> 185 | <Property name="text" type="java.lang.String" value="Remove"/> 186 | </Properties> 187 | <Events> 188 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> 189 | </Events> 190 | </Component> 191 | <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 192 | <AuxValues> 193 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 194 | </AuxValues> 195 | 196 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 197 | <SubComponents> 198 | <Component class="javax.swing.JTable" name="jTable1"> 199 | <Properties> 200 | <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 201 | <Table columnCount="4" rowCount="4"> 202 | <Column editable="false" title="ID" type="java.lang.Object"/> 203 | <Column editable="false" title="Line1" type="java.lang.Object"/> 204 | <Column editable="false" title="Line2" type="java.lang.Object"/> 205 | <Column editable="false" title="City" type="java.lang.Object"/> 206 | </Table> 207 | </Property> 208 | <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 209 | <TableColumnModel selectionModel="0"> 210 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 211 | <Title/> 212 | <Editor/> 213 | <Renderer/> 214 | </Column> 215 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 216 | <Title/> 217 | <Editor/> 218 | <Renderer/> 219 | </Column> 220 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 221 | <Title/> 222 | <Editor/> 223 | <Renderer/> 224 | </Column> 225 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 226 | <Title/> 227 | <Editor/> 228 | <Renderer/> 229 | </Column> 230 | </TableColumnModel> 231 | </Property> 232 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 233 | <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 234 | </Property> 235 | </Properties> 236 | <Events> 237 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTable1MouseClicked"/> 238 | </Events> 239 | </Component> 240 | </SubComponents> 241 | </Container> 242 | <Component class="javax.swing.JLabel" name="jLabel4"> 243 | <Properties> 244 | <Property name="text" type="java.lang.String" value="Employee"/> 245 | </Properties> 246 | </Component> 247 | <Component class="javax.swing.JLabel" name="emailFiled"> 248 | <Properties> 249 | <Property name="text" type="java.lang.String" value="None"/> 250 | </Properties> 251 | </Component> 252 | </SubComponents> 253 | </Container> 254 | </SubComponents> 255 | </Form> 256 | -------------------------------------------------------------------------------- /src/gui/Home.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template 4 | */ 5 | package gui; 6 | 7 | public class Home extends javax.swing.JFrame { 8 | 9 | public Home(String email, String lname, String fname) { 10 | initComponents(); 11 | jLabel2.setText(lname + " " + fname); 12 | jLabel4.setText(email); 13 | if (Signin.getNewType().equals("Cashiya")) { 14 | jButton2.setEnabled(false); 15 | jButton3.setEnabled(false); 16 | } 17 | } 18 | 19 | /** 20 | * This method is called from within the constructor to initialize the form. 21 | * WARNING: Do NOT modify this code. The content of this method is always 22 | * regenerated by the Form Editor. 23 | */ 24 | @SuppressWarnings("unchecked") 25 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 26 | private void initComponents() { 27 | 28 | jPanel1 = new javax.swing.JPanel(); 29 | jLabel1 = new javax.swing.JLabel(); 30 | jLabel2 = new javax.swing.JLabel(); 31 | jLabel3 = new javax.swing.JLabel(); 32 | jLabel4 = new javax.swing.JLabel(); 33 | jButton1 = new javax.swing.JButton(); 34 | jButton2 = new javax.swing.JButton(); 35 | jButton3 = new javax.swing.JButton(); 36 | jButton4 = new javax.swing.JButton(); 37 | jButton5 = new javax.swing.JButton(); 38 | jButton6 = new javax.swing.JButton(); 39 | jLabel5 = new javax.swing.JLabel(); 40 | 41 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 42 | 43 | jLabel1.setText("Name"); 44 | 45 | jLabel2.setText("None"); 46 | 47 | jLabel3.setText("Email"); 48 | 49 | jLabel4.setText("None"); 50 | 51 | jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/customer-questions.png"))); // NOI18N 52 | jButton1.setText("Customer Registation"); 53 | jButton1.addActionListener(new java.awt.event.ActionListener() { 54 | public void actionPerformed(java.awt.event.ActionEvent evt) { 55 | jButton1ActionPerformed(evt); 56 | } 57 | }); 58 | 59 | jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/supplier.png"))); // NOI18N 60 | jButton2.setText("Supplier Registation"); 61 | jButton2.addActionListener(new java.awt.event.ActionListener() { 62 | public void actionPerformed(java.awt.event.ActionEvent evt) { 63 | jButton2ActionPerformed(evt); 64 | } 65 | }); 66 | 67 | jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/employee (1).png"))); // NOI18N 68 | jButton3.setText("Employee Registation "); 69 | jButton3.addActionListener(new java.awt.event.ActionListener() { 70 | public void actionPerformed(java.awt.event.ActionEvent evt) { 71 | jButton3ActionPerformed(evt); 72 | } 73 | }); 74 | 75 | jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/google-docs.png"))); // NOI18N 76 | jButton4.setText("GRN"); 77 | jButton4.addActionListener(new java.awt.event.ActionListener() { 78 | public void actionPerformed(java.awt.event.ActionEvent evt) { 79 | jButton4ActionPerformed(evt); 80 | } 81 | }); 82 | 83 | jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/validating-ticket.png"))); // NOI18N 84 | jButton5.setText("Invoice"); 85 | jButton5.addActionListener(new java.awt.event.ActionListener() { 86 | public void actionPerformed(java.awt.event.ActionEvent evt) { 87 | jButton5ActionPerformed(evt); 88 | } 89 | }); 90 | 91 | jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/inventory (1).png"))); // NOI18N 92 | jButton6.setText("Stock"); 93 | jButton6.addActionListener(new java.awt.event.ActionListener() { 94 | public void actionPerformed(java.awt.event.ActionEvent evt) { 95 | jButton6ActionPerformed(evt); 96 | } 97 | }); 98 | 99 | jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 100 | jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/programmer (1).png"))); // NOI18N 101 | 102 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 103 | jPanel1.setLayout(jPanel1Layout); 104 | jPanel1Layout.setHorizontalGroup( 105 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 106 | .addGroup(jPanel1Layout.createSequentialGroup() 107 | .addGap(10, 10, 10) 108 | .addComponent(jButton1) 109 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 110 | .addComponent(jButton2) 111 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 112 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 113 | .addGap(55, 55, 55) 114 | .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)) 115 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 116 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 117 | .addComponent(jButton3) 118 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 119 | .addComponent(jButton4))) 120 | .addGap(6, 6, 6) 121 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 122 | .addGroup(jPanel1Layout.createSequentialGroup() 123 | .addComponent(jButton5) 124 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 125 | .addComponent(jButton6)) 126 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 127 | .addGroup(jPanel1Layout.createSequentialGroup() 128 | .addComponent(jLabel3) 129 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 130 | .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 131 | .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() 132 | .addComponent(jLabel1) 133 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 134 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))) 135 | .addContainerGap(12, Short.MAX_VALUE)) 136 | ); 137 | jPanel1Layout.setVerticalGroup( 138 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 139 | .addGroup(jPanel1Layout.createSequentialGroup() 140 | .addContainerGap() 141 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 142 | .addGroup(jPanel1Layout.createSequentialGroup() 143 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 144 | .addComponent(jLabel1) 145 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) 146 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 147 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 148 | .addComponent(jLabel3) 149 | .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) 150 | .addGap(10, 10, 10)) 151 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 152 | .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) 153 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) 154 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 155 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) 156 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) 157 | .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) 158 | .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) 159 | .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) 160 | .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)) 161 | .addContainerGap(10, Short.MAX_VALUE)) 162 | ); 163 | 164 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 165 | getContentPane().setLayout(layout); 166 | layout.setHorizontalGroup( 167 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 168 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 169 | ); 170 | layout.setVerticalGroup( 171 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 172 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 173 | ); 174 | 175 | pack(); 176 | setLocationRelativeTo(null); 177 | }// </editor-fold>//GEN-END:initComponents 178 | 179 | private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed 180 | // TODO add your handling code here: 181 | // type(); 182 | stock sk = new stock(); 183 | sk.setVisible(true); 184 | 185 | }//GEN-LAST:event_jButton6ActionPerformed 186 | 187 | private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed 188 | // TODO add your handling code here: 189 | // type(); 190 | invoice in = new invoice(); 191 | in.setVisible(true); 192 | 193 | }//GEN-LAST:event_jButton5ActionPerformed 194 | 195 | private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed 196 | // TODO add your handling code here: 197 | // type(); 198 | grn GRN = new grn(); 199 | GRN.setVisible(true); 200 | 201 | }//GEN-LAST:event_jButton4ActionPerformed 202 | 203 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed 204 | // TODO add your handling code here: 205 | // type(); 206 | empolyee_register emp = new empolyee_register(); 207 | emp.setVisible(true); 208 | // if(type == string) 209 | }//GEN-LAST:event_jButton3ActionPerformed 210 | 211 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 212 | // TODO add your handling code here: 213 | // type(); 214 | suppllerRegister sp = new suppllerRegister(); 215 | sp.setVisible(true); 216 | 217 | }//GEN-LAST:event_jButton2ActionPerformed 218 | 219 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 220 | // TODO add your handling code here: 221 | // type(); 222 | customer_register creg = new customer_register(); 223 | creg.setVisible(true); 224 | 225 | }//GEN-LAST:event_jButton1ActionPerformed 226 | 227 | /** 228 | * @param args the command line arguments 229 | */ 230 | // public static void main(String args[]) { 231 | // /* Set the Nimbus look and feel */ 232 | // //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> 233 | // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 234 | // * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 235 | // */ 236 | // try { 237 | // for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 238 | // if ("Nimbus".equals(info.getName())) { 239 | // javax.swing.UIManager.setLookAndFeel(info.getClassName()); 240 | // break; 241 | // } 242 | // } 243 | // } catch (ClassNotFoundException ex) { 244 | // java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 245 | // } catch (InstantiationException ex) { 246 | // java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 247 | // } catch (IllegalAccessException ex) { 248 | // java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 249 | // } catch (javax.swing.UnsupportedLookAndFeelException ex) { 250 | // java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 251 | // } 252 | // //</editor-fold> 253 | // 254 | // /* Create and display the form */ 255 | // java.awt.EventQueue.invokeLater(new Runnable() { 256 | // public void run() { 257 | // new Home().setVisible(true); 258 | // } 259 | // }); 260 | // } 261 | 262 | // Variables declaration - do not modify//GEN-BEGIN:variables 263 | private javax.swing.JButton jButton1; 264 | private javax.swing.JButton jButton2; 265 | private javax.swing.JButton jButton3; 266 | private javax.swing.JButton jButton4; 267 | private javax.swing.JButton jButton5; 268 | private javax.swing.JButton jButton6; 269 | private javax.swing.JLabel jLabel1; 270 | private javax.swing.JLabel jLabel2; 271 | private javax.swing.JLabel jLabel3; 272 | private javax.swing.JLabel jLabel4; 273 | private javax.swing.JLabel jLabel5; 274 | private javax.swing.JPanel jPanel1; 275 | // End of variables declaration//GEN-END:variables 276 | } 277 | -------------------------------------------------------------------------------- /src/gui/CompanyRegistion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/AWTForms/Dialog.java to edit this template 4 | */ 5 | package gui; 6 | 7 | import com.formdev.flatlaf.themes.FlatMacDarkLaf; 8 | import java.sql.ResultSet; 9 | import java.util.Vector; 10 | import javax.swing.JOptionPane; 11 | import javax.swing.table.DefaultTableModel; 12 | import model.MySQL; 13 | 14 | /** 15 | * 16 | * @author user 17 | */ 18 | public class CompanyRegistion extends java.awt.Dialog { 19 | 20 | suppllerRegister sr; 21 | 22 | /** 23 | * Creates new form CompanyRegistion 24 | */ 25 | public CompanyRegistion(java.awt.Frame parent, boolean modal) { 26 | super(parent, modal); 27 | initComponents(); 28 | loadCompany(); 29 | sr = (suppllerRegister) parent; 30 | } 31 | 32 | private void loadCompany() { 33 | 34 | try { 35 | ResultSet resultset = MySQL.execute("SELECT * FROM `company`"); 36 | 37 | DefaultTableModel table = (DefaultTableModel) jTable1.getModel(); 38 | table.setRowCount(0); 39 | 40 | while (resultset.next()) { 41 | Vector<String> vector = new Vector<>(); 42 | vector.add(resultset.getString("id")); 43 | vector.add(resultset.getString("name")); 44 | vector.add(resultset.getString("hotline")); 45 | 46 | table.addRow(vector); 47 | } 48 | 49 | } catch (Exception e) { 50 | e.printStackTrace(); 51 | } 52 | 53 | } 54 | 55 | private void rest() { 56 | 57 | jTextField2.setText(""); 58 | jTextField3.setText(""); 59 | jTextField1.requestFocus(); 60 | jButton1.setEnabled(true); 61 | jTable1.clearSelection(); 62 | 63 | } 64 | 65 | /** 66 | * This method is called from within the constructor to initialize the form. 67 | * WARNING: Do NOT modify this code. The content of this method is always 68 | * regenerated by the Form Editor. 69 | */ 70 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 71 | private void initComponents() { 72 | 73 | jTextField1 = new javax.swing.JTextField(); 74 | jPanel1 = new javax.swing.JPanel(); 75 | jScrollPane1 = new javax.swing.JScrollPane(); 76 | jTable1 = new javax.swing.JTable(); 77 | jLabel1 = new javax.swing.JLabel(); 78 | jTextField2 = new javax.swing.JTextField(); 79 | jLabel2 = new javax.swing.JLabel(); 80 | jTextField3 = new javax.swing.JTextField(); 81 | jButton1 = new javax.swing.JButton(); 82 | jButton2 = new javax.swing.JButton(); 83 | jButton3 = new javax.swing.JButton(); 84 | 85 | jTextField1.setText("jTextField1"); 86 | 87 | addWindowListener(new java.awt.event.WindowAdapter() { 88 | public void windowClosing(java.awt.event.WindowEvent evt) { 89 | closeDialog(evt); 90 | } 91 | }); 92 | 93 | jTable1.setModel(new javax.swing.table.DefaultTableModel( 94 | new Object [][] { 95 | 96 | }, 97 | new String [] { 98 | "ID", "Company Name", "Hotline Number" 99 | } 100 | ) { 101 | boolean[] canEdit = new boolean [] { 102 | false, false, false 103 | }; 104 | 105 | public boolean isCellEditable(int rowIndex, int columnIndex) { 106 | return canEdit [columnIndex]; 107 | } 108 | }); 109 | jTable1.addMouseListener(new java.awt.event.MouseAdapter() { 110 | public void mouseClicked(java.awt.event.MouseEvent evt) { 111 | jTable1MouseClicked(evt); 112 | } 113 | }); 114 | jScrollPane1.setViewportView(jTable1); 115 | 116 | jLabel1.setText("Name"); 117 | 118 | jLabel2.setText("Hotline"); 119 | jLabel2.setToolTipText(""); 120 | 121 | jButton1.setText("Add"); 122 | jButton1.addActionListener(new java.awt.event.ActionListener() { 123 | public void actionPerformed(java.awt.event.ActionEvent evt) { 124 | jButton1ActionPerformed(evt); 125 | } 126 | }); 127 | 128 | jButton2.setText("Update"); 129 | jButton2.addActionListener(new java.awt.event.ActionListener() { 130 | public void actionPerformed(java.awt.event.ActionEvent evt) { 131 | jButton2ActionPerformed(evt); 132 | } 133 | }); 134 | 135 | jButton3.addActionListener(new java.awt.event.ActionListener() { 136 | public void actionPerformed(java.awt.event.ActionEvent evt) { 137 | jButton3ActionPerformed(evt); 138 | } 139 | }); 140 | 141 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 142 | jPanel1.setLayout(jPanel1Layout); 143 | jPanel1Layout.setHorizontalGroup( 144 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 145 | .addGroup(jPanel1Layout.createSequentialGroup() 146 | .addGap(10, 10, 10) 147 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 148 | .addComponent(jScrollPane1) 149 | .addGroup(jPanel1Layout.createSequentialGroup() 150 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) 151 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 152 | .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) 153 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 154 | .addComponent(jLabel2) 155 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 156 | .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) 157 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 158 | .addComponent(jButton1) 159 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 160 | .addComponent(jButton2) 161 | .addGap(18, 18, 18) 162 | .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))) 163 | .addContainerGap(10, Short.MAX_VALUE)) 164 | ); 165 | jPanel1Layout.setVerticalGroup( 166 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 167 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 168 | .addGap(10, 10, 10) 169 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 170 | .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 171 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 172 | .addComponent(jLabel1) 173 | .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 174 | .addComponent(jLabel2) 175 | .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 176 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 177 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))) 178 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE) 179 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE) 180 | .addGap(10, 10, 10)) 181 | ); 182 | 183 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 184 | this.setLayout(layout); 185 | layout.setHorizontalGroup( 186 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 187 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 188 | ); 189 | layout.setVerticalGroup( 190 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 191 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 192 | ); 193 | 194 | pack(); 195 | setLocationRelativeTo(null); 196 | }// </editor-fold>//GEN-END:initComponents 197 | 198 | /** 199 | * Closes the dialog 200 | */ 201 | private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog 202 | setVisible(false); 203 | dispose(); 204 | }//GEN-LAST:event_closeDialog 205 | 206 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed 207 | // TODO add your handling code here: 208 | }//GEN-LAST:event_jButton3ActionPerformed 209 | 210 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 211 | // TODO add your handling code here: 212 | 213 | String name = jTextField2.getText(); 214 | String hotline = jTextField3.getText(); 215 | 216 | if (name.isEmpty()) { 217 | JOptionPane.showMessageDialog(this, "Please Enter Company Name", "warning", JOptionPane.INFORMATION_MESSAGE); 218 | } else if (hotline.isEmpty()) { 219 | JOptionPane.showMessageDialog(this, "Please Enter Company Hotline Number", "warning", JOptionPane.INFORMATION_MESSAGE); 220 | } else if (!hotline.matches("^0((11)|(2(1|[3-7]))|(3[1-8])|(4(1|5|7))|(5(1|2|4|5|7))|(6(3|[5-7]))|([8-9]1))[0-9]{7}$")) { 221 | JOptionPane.showMessageDialog(this, "Invalid Hotline Number", "warning", JOptionPane.INFORMATION_MESSAGE); 222 | } else { 223 | 224 | try { 225 | 226 | ResultSet resultset = MySQL.execute("SELECT * FROM `company` WHERE `name`='" + name + "' OR `hotline`='" + hotline + "'"); 227 | if (resultset.next()) { 228 | JOptionPane.showMessageDialog(this, "Company Name or Hotline already used.", "warning", JOptionPane.INFORMATION_MESSAGE); 229 | } 230 | 231 | MySQL.execute("INSERT INTO `company`(`name`,`hotline`)VALUES('" + name + "','" + hotline + "')"); 232 | loadCompany(); 233 | rest(); 234 | } catch (Exception e) { 235 | e.printStackTrace(); 236 | } 237 | 238 | } 239 | 240 | }//GEN-LAST:event_jButton1ActionPerformed 241 | 242 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 243 | // TODO add your handling code here: 244 | 245 | if (jTable1.getSelectedRow() == -1) { 246 | JOptionPane.showMessageDialog(this, "Please Select Company to Update", "warning", JOptionPane.INFORMATION_MESSAGE); 247 | } else { 248 | 249 | String name = jTextField2.getText(); 250 | String hotline = jTextField3.getText(); 251 | 252 | int row = jTable1.getSelectedRow(); 253 | String id = String.valueOf(jTable1.getValueAt(row, 0)); 254 | 255 | String selectName = String.valueOf(jTable1.getValueAt(row, 1)); 256 | String selectHotline = String.valueOf(jTable1.getValueAt(row, 2)); 257 | 258 | if (name.isEmpty()) { 259 | JOptionPane.showMessageDialog(this, "Please Enter Company Name", "warning", JOptionPane.INFORMATION_MESSAGE); 260 | } else if (hotline.isEmpty()) { 261 | JOptionPane.showMessageDialog(this, "Please Enter Company Hotline Number", "warning", JOptionPane.INFORMATION_MESSAGE); 262 | } else if (!hotline.matches("^0((11)|(2(1|[3-7]))|(3[1-8])|(4(1|5|7))|(5(1|2|4|5|7))|(6(3|[5-7]))|([8-9]1))[0-9]{7}$")) { 263 | JOptionPane.showMessageDialog(this, "Invalid Hotline Number", "warning", JOptionPane.INFORMATION_MESSAGE); 264 | } else if (selectName.equals(name) && selectHotline.equals(hotline)) { 265 | JOptionPane.showMessageDialog(this, "Please Change Name or Hotline Number", "warning", JOptionPane.INFORMATION_MESSAGE); 266 | } else { 267 | 268 | try { 269 | 270 | ResultSet resultset = MySQL.execute("SELECT * FROM `company` WHERE (`name`='" + name + "' OR `hotline`='" + hotline + "') AND `id`='" + id + "'"); 271 | if (resultset.next()) { 272 | JOptionPane.showMessageDialog(this, "Company Name or Hotline already used.", "warning", JOptionPane.INFORMATION_MESSAGE); 273 | } 274 | 275 | MySQL.execute("UPDATE `company` SET `name`='" + name + "',`hotline`='" + hotline + "' WHERE `id`='" + id + "'"); 276 | loadCompany(); 277 | rest(); 278 | } catch (Exception e) { 279 | e.printStackTrace(); 280 | } 281 | 282 | } 283 | 284 | } 285 | 286 | }//GEN-LAST:event_jButton2ActionPerformed 287 | 288 | private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked 289 | // TODO add your handling code here: 290 | 291 | int row = jTable1.getSelectedRow(); 292 | 293 | jTextField2.setText(String.valueOf(jTable1.getValueAt(row, 1))); 294 | jTextField3.setText(String.valueOf(jTable1.getValueAt(row, 2))); 295 | 296 | jButton1.setEnabled(false); 297 | 298 | if (evt.getClickCount() == 2) { 299 | 300 | String name = String.valueOf(jTable1.getValueAt(row, 1)); 301 | // sr.getjTextField1().setText(name); 302 | sr.comapnyName(name); 303 | this.dispose(); 304 | // sr.getjTextField2().requestFocus(); 305 | sr.gragFourcs(); 306 | 307 | sr.setCompanyID(String.valueOf(jTable1.getValueAt(row, 0))); 308 | this.dispose(); 309 | } 310 | 311 | }//GEN-LAST:event_jTable1MouseClicked 312 | 313 | /** 314 | * @param args the command line arguments 315 | */ 316 | public static void main(String args[]) { 317 | 318 | java.awt.EventQueue.invokeLater(new Runnable() { 319 | public void run() { 320 | CompanyRegistion dialog = new CompanyRegistion(new java.awt.Frame(), true); 321 | dialog.addWindowListener(new java.awt.event.WindowAdapter() { 322 | public void windowClosing(java.awt.event.WindowEvent e) { 323 | System.exit(0); 324 | } 325 | }); 326 | dialog.setVisible(true); 327 | } 328 | }); 329 | } 330 | 331 | 332 | // Variables declaration - do not modify//GEN-BEGIN:variables 333 | private javax.swing.JButton jButton1; 334 | private javax.swing.JButton jButton2; 335 | private javax.swing.JButton jButton3; 336 | private javax.swing.JLabel jLabel1; 337 | private javax.swing.JLabel jLabel2; 338 | private javax.swing.JPanel jPanel1; 339 | private javax.swing.JScrollPane jScrollPane1; 340 | private javax.swing.JTable jTable1; 341 | private javax.swing.JTextField jTextField1; 342 | private javax.swing.JTextField jTextField2; 343 | private javax.swing.JTextField jTextField3; 344 | // End of variables declaration//GEN-END:variables 345 | } 346 | -------------------------------------------------------------------------------- /src/gui/AddressView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template 4 | */ 5 | package gui; 6 | 7 | import java.sql.ResultSet; 8 | import java.util.HashMap; 9 | import java.util.Vector; 10 | import javax.swing.DefaultComboBoxModel; 11 | import javax.swing.JOptionPane; 12 | import javax.swing.table.DefaultTableModel; 13 | import model.MySQL; 14 | 15 | /** 16 | * 17 | * @author user 18 | */ 19 | public class AddressView extends javax.swing.JDialog { 20 | 21 | private String email; 22 | private HashMap<String, String> cityMap = new HashMap<>(); 23 | 24 | /** 25 | * Creates new form AddressView 26 | */ 27 | public AddressView(java.awt.Frame parent, boolean model, String em) { 28 | super(parent, model); 29 | initComponents(); 30 | emailFiled.setText(em); 31 | this.email = em; 32 | loadAddress(); 33 | loadCity(); 34 | } 35 | 36 | private void loadAddress() { 37 | 38 | try { 39 | ResultSet resultset = MySQL.execute("SELECT * FROM `employee_address` INNER JOIN `city` ON `employee_address`.`city_id`=`city`.`id` WHERE `employee_email`='" + this.email + "' "); 40 | 41 | DefaultTableModel model = (DefaultTableModel) jTable1.getModel(); 42 | model.setRowCount(0); 43 | 44 | while (resultset.next()) { 45 | Vector<String> vector = new Vector<>(); 46 | vector.add(resultset.getString("id")); 47 | vector.add(resultset.getString("line1")); 48 | vector.add(resultset.getString("line2")); 49 | vector.add(resultset.getString("city.name")); 50 | 51 | model.addRow(vector); 52 | } 53 | 54 | } catch (Exception e) { 55 | e.printStackTrace(); 56 | } 57 | 58 | } 59 | 60 | private void clera() { 61 | 62 | jTextField1.setText(""); 63 | jTextField2.setText(""); 64 | jComboBox1.setSelectedIndex(0); 65 | jTextField1.requestFocus(); 66 | 67 | } 68 | 69 | private void loadCity() { 70 | 71 | try { 72 | 73 | ResultSet resultSet = MySQL.execute("SELECT * FROM `city`"); 74 | 75 | Vector<String> value = new Vector<>(); 76 | value.add("Select"); 77 | 78 | while (resultSet.next()) { 79 | value.add(resultSet.getString("name")); 80 | cityMap.put(resultSet.getString("name"), resultSet.getString("id")); 81 | } 82 | 83 | jComboBox1.setModel(new DefaultComboBoxModel<>(value)); 84 | 85 | } catch (Exception e) { 86 | e.printStackTrace(); 87 | } 88 | 89 | } 90 | 91 | /** 92 | * This method is called from within the constructor to initialize the form. 93 | * WARNING: Do NOT modify this code. The content of this method is always 94 | * regenerated by the Form Editor. 95 | */ 96 | @SuppressWarnings("unchecked") 97 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 98 | private void initComponents() { 99 | 100 | jPanel1 = new javax.swing.JPanel(); 101 | jLabel1 = new javax.swing.JLabel(); 102 | jLabel2 = new javax.swing.JLabel(); 103 | jLabel3 = new javax.swing.JLabel(); 104 | jTextField1 = new javax.swing.JTextField(); 105 | jTextField2 = new javax.swing.JTextField(); 106 | jComboBox1 = new javax.swing.JComboBox<>(); 107 | jButton1 = new javax.swing.JButton(); 108 | jButton2 = new javax.swing.JButton(); 109 | jButton3 = new javax.swing.JButton(); 110 | jScrollPane1 = new javax.swing.JScrollPane(); 111 | jTable1 = new javax.swing.JTable(); 112 | jLabel4 = new javax.swing.JLabel(); 113 | emailFiled = new javax.swing.JLabel(); 114 | 115 | setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 116 | 117 | jLabel1.setText("Address Line1"); 118 | 119 | jLabel2.setText("Address Line2"); 120 | 121 | jLabel3.setText("City"); 122 | 123 | jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); 124 | 125 | jButton1.setText("Add"); 126 | jButton1.addActionListener(new java.awt.event.ActionListener() { 127 | public void actionPerformed(java.awt.event.ActionEvent evt) { 128 | jButton1ActionPerformed(evt); 129 | } 130 | }); 131 | 132 | jButton2.setText("Update"); 133 | jButton2.addActionListener(new java.awt.event.ActionListener() { 134 | public void actionPerformed(java.awt.event.ActionEvent evt) { 135 | jButton2ActionPerformed(evt); 136 | } 137 | }); 138 | 139 | jButton3.setText("Remove"); 140 | jButton3.addActionListener(new java.awt.event.ActionListener() { 141 | public void actionPerformed(java.awt.event.ActionEvent evt) { 142 | jButton3ActionPerformed(evt); 143 | } 144 | }); 145 | 146 | jTable1.setModel(new javax.swing.table.DefaultTableModel( 147 | new Object [][] { 148 | {null, null, null, null}, 149 | {null, null, null, null}, 150 | {null, null, null, null}, 151 | {null, null, null, null} 152 | }, 153 | new String [] { 154 | "ID", "Line1", "Line2", "City" 155 | } 156 | ) { 157 | boolean[] canEdit = new boolean [] { 158 | false, false, false, false 159 | }; 160 | 161 | public boolean isCellEditable(int rowIndex, int columnIndex) { 162 | return canEdit [columnIndex]; 163 | } 164 | }); 165 | jTable1.addMouseListener(new java.awt.event.MouseAdapter() { 166 | public void mouseClicked(java.awt.event.MouseEvent evt) { 167 | jTable1MouseClicked(evt); 168 | } 169 | }); 170 | jScrollPane1.setViewportView(jTable1); 171 | 172 | jLabel4.setText("Employee"); 173 | 174 | emailFiled.setText("None"); 175 | 176 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 177 | jPanel1.setLayout(jPanel1Layout); 178 | jPanel1Layout.setHorizontalGroup( 179 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 180 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 181 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 182 | .addGroup(jPanel1Layout.createSequentialGroup() 183 | .addContainerGap() 184 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) 185 | .addGap(25, 25, 25) 186 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) 187 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE) 188 | .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) 189 | .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() 190 | .addGap(10, 10, 10) 191 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 192 | .addGroup(jPanel1Layout.createSequentialGroup() 193 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) 194 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 195 | .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 196 | .addGroup(jPanel1Layout.createSequentialGroup() 197 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) 198 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 199 | .addComponent(jTextField1)) 200 | .addGroup(jPanel1Layout.createSequentialGroup() 201 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 202 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) 203 | .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)) 204 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 205 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 206 | .addComponent(emailFiled, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 207 | .addComponent(jTextField2)))))) 208 | .addGap(10, 10, 10)) 209 | .addGroup(jPanel1Layout.createSequentialGroup() 210 | .addContainerGap() 211 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 353, javax.swing.GroupLayout.PREFERRED_SIZE) 212 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 213 | ); 214 | jPanel1Layout.setVerticalGroup( 215 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 216 | .addGroup(jPanel1Layout.createSequentialGroup() 217 | .addGap(10, 10, 10) 218 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 219 | .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) 220 | .addComponent(emailFiled, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)) 221 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 222 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 223 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) 224 | .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) 225 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 226 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 227 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) 228 | .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) 229 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 230 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 231 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) 232 | .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) 233 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 234 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 235 | .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 236 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 237 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 238 | .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))) 239 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 240 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) 241 | .addContainerGap()) 242 | ); 243 | 244 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 245 | getContentPane().setLayout(layout); 246 | layout.setHorizontalGroup( 247 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 248 | .addGroup(layout.createSequentialGroup() 249 | .addContainerGap() 250 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 251 | .addContainerGap()) 252 | ); 253 | layout.setVerticalGroup( 254 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 255 | .addGroup(layout.createSequentialGroup() 256 | .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 257 | .addGap(0, 10, Short.MAX_VALUE)) 258 | ); 259 | 260 | pack(); 261 | setLocationRelativeTo(null); 262 | }// </editor-fold>//GEN-END:initComponents 263 | 264 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed 265 | // TODO add your handling code here: 266 | 267 | try { 268 | 269 | int row = jTable1.getSelectedRow(); 270 | 271 | if (row == -1) { 272 | JOptionPane.showMessageDialog(this, "Select your Row", "warning", JOptionPane.INFORMATION_MESSAGE); 273 | } else { 274 | 275 | String id = String.valueOf(jTable1.getValueAt(row, 0)); 276 | 277 | MySQL.execute("DELETE FROM `employee_address` WHERE `id`='" + id + "'"); 278 | 279 | loadAddress(); 280 | 281 | clera(); 282 | 283 | } 284 | 285 | } catch (Exception e) { 286 | e.printStackTrace(); 287 | } 288 | 289 | 290 | }//GEN-LAST:event_jButton3ActionPerformed 291 | 292 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 293 | // TODO add your handling code here: 294 | 295 | try { 296 | 297 | int row = jTable1.getSelectedRow(); 298 | 299 | if (row == -1) { 300 | JOptionPane.showMessageDialog(this, "Please Select your row ", "warning", JOptionPane.INFORMATION_MESSAGE); 301 | } else { 302 | String id = String.valueOf(jTable1.getValueAt(row, 0)); 303 | 304 | String line1 = jTextField1.getText(); 305 | String line2 = jTextField2.getText(); 306 | String city = String.valueOf(jComboBox1.getSelectedItem()); 307 | 308 | if (line1.isEmpty()) { 309 | JOptionPane.showMessageDialog(this, "Type your Address line1 ", "warning", JOptionPane.INFORMATION_MESSAGE); 310 | } else if (line2.isEmpty()) { 311 | JOptionPane.showMessageDialog(this, "Type your Address line2 ", "warning", JOptionPane.INFORMATION_MESSAGE); 312 | 313 | } else if (city.equals("Select")) { 314 | JOptionPane.showMessageDialog(this, "Select your City", "warning", JOptionPane.INFORMATION_MESSAGE); 315 | } else { 316 | 317 | MySQL.execute("UPDATE `employee_address` SET `line1`='" + line1 + "',`line2`='" + line2 + "',`city_id`='" + cityMap.get(city) + "' WHERE `id`='" + id + "'"); 318 | 319 | loadAddress(); 320 | clera(); 321 | 322 | } 323 | } 324 | 325 | } catch (Exception e) { 326 | e.printStackTrace(); 327 | } 328 | 329 | 330 | }//GEN-LAST:event_jButton2ActionPerformed 331 | 332 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 333 | // TODO add your handling code here: 334 | 335 | try { 336 | 337 | String line1 = jTextField1.getText(); 338 | String line2 = jTextField2.getText(); 339 | String city = String.valueOf(jComboBox1.getSelectedItem()); 340 | 341 | if (line1.isEmpty()) { 342 | JOptionPane.showMessageDialog(this, "Type your Address line1 ", "warning", JOptionPane.INFORMATION_MESSAGE); 343 | } else if (line2.isEmpty()) { 344 | JOptionPane.showMessageDialog(this, "Type your Address line2 ", "warning", JOptionPane.INFORMATION_MESSAGE); 345 | } else if (city.equals("Select")) { 346 | JOptionPane.showMessageDialog(this, "Select your City", "warning", JOptionPane.INFORMATION_MESSAGE); 347 | } else { 348 | 349 | boolean isFound = false; 350 | 351 | for (int row = 0; row < jTable1.getRowCount(); row++) { 352 | 353 | String getLine1 = String.valueOf(jTable1.getValueAt(row, 1)); 354 | String getLine2 = String.valueOf(jTable1.getValueAt(row, 2)); 355 | String getCity = String.valueOf(jTable1.getValueAt(row, 3)); 356 | 357 | if (line1.equals(getLine1) && line2.equals(getLine2) && city.equals(getCity)) { 358 | JOptionPane.showMessageDialog(this, "Address alreay added", "warning", JOptionPane.INFORMATION_MESSAGE); 359 | isFound = true; 360 | break; 361 | } 362 | 363 | } 364 | 365 | if (!isFound) { 366 | MySQL.execute("INSERT INTO `employee_address`(`line1`,`line2`,`city_id`,`employee_email`) VALUES('" + line1 + "','" + line2 + "','" + cityMap.get(city) + "','" + this.email + "')"); 367 | 368 | loadAddress(); 369 | clera(); 370 | } 371 | 372 | } 373 | 374 | } catch (Exception e) { 375 | e.printStackTrace(); 376 | } 377 | 378 | 379 | }//GEN-LAST:event_jButton1ActionPerformed 380 | 381 | private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked 382 | // TODO add your handling code here: 383 | 384 | int row = jTable1.getSelectedRow(); 385 | 386 | jTextField1.setText(String.valueOf(jTable1.getValueAt(row, 1))); 387 | jTextField2.setText(String.valueOf(jTable1.getValueAt(row, 2))); 388 | jComboBox1.setSelectedItem(String.valueOf(jTable1.getValueAt(row, 3))); 389 | }//GEN-LAST:event_jTable1MouseClicked 390 | 391 | /** 392 | * @param args the command line arguments 393 | */ 394 | // public static void main(String args[]) { 395 | // /* Set the Nimbus look and feel */ 396 | // //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> 397 | // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 398 | // * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 399 | // */ 400 | // try { 401 | // for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 402 | // if ("Nimbus".equals(info.getName())) { 403 | // javax.swing.UIManager.setLookAndFeel(info.getClassName()); 404 | // break; 405 | // } 406 | // } 407 | // } catch (ClassNotFoundException ex) { 408 | // java.util.logging.Logger.getLogger(AddressView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 409 | // } catch (InstantiationException ex) { 410 | // java.util.logging.Logger.getLogger(AddressView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 411 | // } catch (IllegalAccessException ex) { 412 | // java.util.logging.Logger.getLogger(AddressView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 413 | // } catch (javax.swing.UnsupportedLookAndFeelException ex) { 414 | // java.util.logging.Logger.getLogger(AddressView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 415 | // } 416 | // //</editor-fold> 417 | // 418 | // /* Create and display the form */ 419 | // java.awt.EventQueue.invokeLater(new Runnable() { 420 | // public void run() { 421 | // new AddressView().setVisible(true); 422 | // } 423 | // }); 424 | // } 425 | 426 | // Variables declaration - do not modify//GEN-BEGIN:variables 427 | private javax.swing.JLabel emailFiled; 428 | private javax.swing.JButton jButton1; 429 | private javax.swing.JButton jButton2; 430 | private javax.swing.JButton jButton3; 431 | private javax.swing.JComboBox<String> jComboBox1; 432 | private javax.swing.JLabel jLabel1; 433 | private javax.swing.JLabel jLabel2; 434 | private javax.swing.JLabel jLabel3; 435 | private javax.swing.JLabel jLabel4; 436 | private javax.swing.JPanel jPanel1; 437 | private javax.swing.JScrollPane jScrollPane1; 438 | private javax.swing.JTable jTable1; 439 | private javax.swing.JTextField jTextField1; 440 | private javax.swing.JTextField jTextField2; 441 | // End of variables declaration//GEN-END:variables 442 | 443 | } 444 | -------------------------------------------------------------------------------- /src/gui/empolyee_register.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="3"/> 6 | </Properties> 7 | <SyntheticProperties> 8 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 9 | <SyntheticProperty name="generateCenter" type="boolean" value="true"/> 10 | </SyntheticProperties> 11 | <AuxValues> 12 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 13 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 14 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 15 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 17 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 18 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 19 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 20 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 21 | </AuxValues> 22 | 23 | <Layout> 24 | <DimensionLayout dim="0"> 25 | <Group type="103" groupAlignment="0" attributes="0"> 26 | <Group type="102" alignment="1" attributes="0"> 27 | <EmptySpace max="32767" attributes="0"/> 28 | <Component id="jPanel1" min="-2" max="-2" attributes="0"/> 29 | <EmptySpace max="-2" attributes="0"/> 30 | </Group> 31 | </Group> 32 | </DimensionLayout> 33 | <DimensionLayout dim="1"> 34 | <Group type="103" groupAlignment="0" attributes="0"> 35 | <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> 36 | </Group> 37 | </DimensionLayout> 38 | </Layout> 39 | <SubComponents> 40 | <Container class="javax.swing.JPanel" name="jPanel1"> 41 | 42 | <Layout> 43 | <DimensionLayout dim="0"> 44 | <Group type="103" groupAlignment="0" attributes="0"> 45 | <Group type="102" alignment="0" attributes="0"> 46 | <Component id="jPanel2" min="-2" max="-2" attributes="0"/> 47 | <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 48 | <Component id="jScrollPane1" min="-2" pref="685" max="-2" attributes="0"/> 49 | <EmptySpace pref="11" max="32767" attributes="0"/> 50 | </Group> 51 | </Group> 52 | </DimensionLayout> 53 | <DimensionLayout dim="1"> 54 | <Group type="103" groupAlignment="0" attributes="0"> 55 | <Group type="102" alignment="0" attributes="0"> 56 | <Component id="jPanel2" min="-2" max="-2" attributes="0"/> 57 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 58 | </Group> 59 | <Group type="102" alignment="0" attributes="0"> 60 | <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 61 | <Component id="jScrollPane1" min="-2" pref="396" max="-2" attributes="0"/> 62 | <EmptySpace pref="11" max="32767" attributes="0"/> 63 | </Group> 64 | </Group> 65 | </DimensionLayout> 66 | </Layout> 67 | <SubComponents> 68 | <Container class="javax.swing.JPanel" name="jPanel2"> 69 | 70 | <Layout> 71 | <DimensionLayout dim="0"> 72 | <Group type="103" groupAlignment="0" attributes="0"> 73 | <Group type="102" alignment="1" attributes="0"> 74 | <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 75 | <Group type="103" groupAlignment="1" attributes="0"> 76 | <Component id="updateButton" max="32767" attributes="0"/> 77 | <Component id="insertButton" alignment="0" max="32767" attributes="0"/> 78 | <Group type="102" alignment="0" attributes="0"> 79 | <Component id="jLabel4" max="32767" attributes="0"/> 80 | <EmptySpace type="separate" max="-2" attributes="0"/> 81 | <Component id="nic" min="-2" pref="189" max="-2" attributes="0"/> 82 | </Group> 83 | <Group type="102" alignment="0" attributes="0"> 84 | <Component id="jLabel6" min="-2" pref="58" max="-2" attributes="0"/> 85 | <EmptySpace type="separate" max="-2" attributes="0"/> 86 | <Component id="typeCombox" max="32767" attributes="0"/> 87 | </Group> 88 | <Group type="102" alignment="0" attributes="0"> 89 | <Component id="jLabel7" min="-2" pref="58" max="-2" attributes="0"/> 90 | <EmptySpace type="separate" max="-2" attributes="0"/> 91 | <Component id="password" max="32767" attributes="0"/> 92 | </Group> 93 | <Group type="102" alignment="0" attributes="0"> 94 | <Component id="jLabel8" min="-2" pref="58" max="-2" attributes="0"/> 95 | <EmptySpace type="separate" max="-2" attributes="0"/> 96 | <Component id="genderCombox" max="32767" attributes="0"/> 97 | </Group> 98 | <Group type="102" alignment="0" attributes="0"> 99 | <Group type="103" groupAlignment="1" max="-2" attributes="0"> 100 | <Group type="102" alignment="0" attributes="0"> 101 | <Component id="jLabel1" min="-2" pref="58" max="-2" attributes="0"/> 102 | <EmptySpace type="separate" max="-2" attributes="0"/> 103 | <Component id="email" max="32767" attributes="0"/> 104 | <EmptySpace max="-2" attributes="0"/> 105 | <Component id="jButton1" min="-2" max="-2" attributes="0"/> 106 | </Group> 107 | <Group type="103" groupAlignment="0" attributes="0"> 108 | <Group type="102" alignment="0" attributes="0"> 109 | <Component id="jLabel2" min="-2" pref="58" max="-2" attributes="0"/> 110 | <EmptySpace type="separate" max="-2" attributes="0"/> 111 | <Component id="firstName" min="-2" pref="189" max="-2" attributes="0"/> 112 | </Group> 113 | <Group type="102" alignment="0" attributes="0"> 114 | <Component id="jLabel3" min="-2" pref="58" max="-2" attributes="0"/> 115 | <EmptySpace type="separate" max="-2" attributes="0"/> 116 | <Component id="lastName" min="-2" pref="189" max="-2" attributes="0"/> 117 | </Group> 118 | <Group type="102" alignment="0" attributes="0"> 119 | <Component id="jLabel5" min="-2" pref="58" max="-2" attributes="0"/> 120 | <EmptySpace type="separate" max="-2" attributes="0"/> 121 | <Component id="mbile" min="-2" pref="189" max="-2" attributes="0"/> 122 | </Group> 123 | </Group> 124 | </Group> 125 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 126 | </Group> 127 | </Group> 128 | <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 129 | </Group> 130 | </Group> 131 | </DimensionLayout> 132 | <DimensionLayout dim="1"> 133 | <Group type="103" groupAlignment="0" attributes="0"> 134 | <Group type="102" alignment="0" attributes="0"> 135 | <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 136 | <Group type="103" groupAlignment="0" attributes="0"> 137 | <Group type="102" attributes="0"> 138 | <Component id="email" min="-2" pref="35" max="-2" attributes="0"/> 139 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 140 | </Group> 141 | <Component id="jLabel1" max="32767" attributes="0"/> 142 | <Component id="jButton1" alignment="0" max="32767" attributes="0"/> 143 | </Group> 144 | <EmptySpace max="-2" attributes="0"/> 145 | <Group type="103" groupAlignment="3" attributes="0"> 146 | <Component id="jLabel2" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 147 | <Component id="firstName" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 148 | </Group> 149 | <EmptySpace max="-2" attributes="0"/> 150 | <Group type="103" groupAlignment="3" attributes="0"> 151 | <Component id="jLabel3" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 152 | <Component id="lastName" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 153 | </Group> 154 | <EmptySpace max="-2" attributes="0"/> 155 | <Group type="103" groupAlignment="3" attributes="0"> 156 | <Component id="jLabel4" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 157 | <Component id="nic" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 158 | </Group> 159 | <EmptySpace max="-2" attributes="0"/> 160 | <Group type="103" groupAlignment="3" attributes="0"> 161 | <Component id="jLabel5" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 162 | <Component id="mbile" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 163 | </Group> 164 | <EmptySpace max="-2" attributes="0"/> 165 | <Group type="103" groupAlignment="3" attributes="0"> 166 | <Component id="jLabel7" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 167 | <Component id="password" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 168 | </Group> 169 | <EmptySpace max="-2" attributes="0"/> 170 | <Group type="103" groupAlignment="3" attributes="0"> 171 | <Component id="jLabel6" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 172 | <Component id="typeCombox" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 173 | </Group> 174 | <EmptySpace max="-2" attributes="0"/> 175 | <Group type="103" groupAlignment="3" attributes="0"> 176 | <Component id="jLabel8" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 177 | <Component id="genderCombox" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 178 | </Group> 179 | <EmptySpace max="-2" attributes="0"/> 180 | <Component id="insertButton" min="-2" pref="30" max="-2" attributes="0"/> 181 | <EmptySpace max="-2" attributes="0"/> 182 | <Component id="updateButton" min="-2" pref="30" max="-2" attributes="0"/> 183 | <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 184 | </Group> 185 | </Group> 186 | </DimensionLayout> 187 | </Layout> 188 | <SubComponents> 189 | <Component class="javax.swing.JLabel" name="jLabel1"> 190 | <Properties> 191 | <Property name="text" type="java.lang.String" value="Eamil"/> 192 | </Properties> 193 | </Component> 194 | <Component class="javax.swing.JLabel" name="jLabel2"> 195 | <Properties> 196 | <Property name="text" type="java.lang.String" value="First Name"/> 197 | </Properties> 198 | </Component> 199 | <Component class="javax.swing.JLabel" name="jLabel3"> 200 | <Properties> 201 | <Property name="text" type="java.lang.String" value="Last Name"/> 202 | </Properties> 203 | </Component> 204 | <Component class="javax.swing.JLabel" name="jLabel4"> 205 | <Properties> 206 | <Property name="text" type="java.lang.String" value="NIC"/> 207 | </Properties> 208 | </Component> 209 | <Component class="javax.swing.JLabel" name="jLabel5"> 210 | <Properties> 211 | <Property name="text" type="java.lang.String" value="Mobile"/> 212 | </Properties> 213 | </Component> 214 | <Component class="javax.swing.JLabel" name="jLabel6"> 215 | <Properties> 216 | <Property name="text" type="java.lang.String" value="Type"/> 217 | </Properties> 218 | </Component> 219 | <Component class="javax.swing.JLabel" name="jLabel7"> 220 | <Properties> 221 | <Property name="text" type="java.lang.String" value="Password"/> 222 | </Properties> 223 | </Component> 224 | <Component class="javax.swing.JLabel" name="jLabel8"> 225 | <Properties> 226 | <Property name="text" type="java.lang.String" value="Gender"/> 227 | </Properties> 228 | </Component> 229 | <Component class="javax.swing.JTextField" name="email"> 230 | <Events> 231 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="emailActionPerformed"/> 232 | </Events> 233 | </Component> 234 | <Component class="javax.swing.JTextField" name="mbile"> 235 | </Component> 236 | <Component class="javax.swing.JTextField" name="firstName"> 237 | </Component> 238 | <Component class="javax.swing.JTextField" name="lastName"> 239 | </Component> 240 | <Component class="javax.swing.JTextField" name="nic"> 241 | </Component> 242 | <Component class="javax.swing.JPasswordField" name="password"> 243 | </Component> 244 | <Component class="javax.swing.JComboBox" name="typeCombox"> 245 | <Properties> 246 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 247 | <StringArray count="4"> 248 | <StringItem index="0" value="Item 1"/> 249 | <StringItem index="1" value="Item 2"/> 250 | <StringItem index="2" value="Item 3"/> 251 | <StringItem index="3" value="Item 4"/> 252 | </StringArray> 253 | </Property> 254 | </Properties> 255 | <AuxValues> 256 | <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 257 | </AuxValues> 258 | </Component> 259 | <Component class="javax.swing.JComboBox" name="genderCombox"> 260 | <Properties> 261 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 262 | <StringArray count="4"> 263 | <StringItem index="0" value="Item 1"/> 264 | <StringItem index="1" value="Item 2"/> 265 | <StringItem index="2" value="Item 3"/> 266 | <StringItem index="3" value="Item 4"/> 267 | </StringArray> 268 | </Property> 269 | </Properties> 270 | <AuxValues> 271 | <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 272 | </AuxValues> 273 | </Component> 274 | <Component class="javax.swing.JButton" name="insertButton"> 275 | <Properties> 276 | <Property name="text" type="java.lang.String" value="Create Account"/> 277 | </Properties> 278 | <Events> 279 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="insertButtonActionPerformed"/> 280 | </Events> 281 | </Component> 282 | <Component class="javax.swing.JButton" name="updateButton"> 283 | <Properties> 284 | <Property name="text" type="java.lang.String" value="Update Account"/> 285 | </Properties> 286 | <Events> 287 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="updateButtonActionPerformed"/> 288 | </Events> 289 | </Component> 290 | <Component class="javax.swing.JButton" name="jButton1"> 291 | <Properties> 292 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 293 | <Image iconType="3" name="/img/reload.png"/> 294 | </Property> 295 | </Properties> 296 | <Events> 297 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> 298 | </Events> 299 | </Component> 300 | </SubComponents> 301 | </Container> 302 | <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 303 | <AuxValues> 304 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 305 | </AuxValues> 306 | 307 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 308 | <SubComponents> 309 | <Component class="javax.swing.JTable" name="empolyeeTable"> 310 | <Properties> 311 | <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 312 | <Table columnCount="8" rowCount="0"> 313 | <Column editable="false" title="Email" type="java.lang.Object"/> 314 | <Column editable="false" title="First Name" type="java.lang.Object"/> 315 | <Column editable="false" title="Last Name" type="java.lang.Object"/> 316 | <Column editable="false" title="NIC" type="java.lang.Object"/> 317 | <Column editable="false" title="Mobile" type="java.lang.Object"/> 318 | <Column editable="false" title="Gender" type="java.lang.Object"/> 319 | <Column editable="false" title="Password" type="java.lang.Object"/> 320 | <Column editable="false" title="Type" type="java.lang.Object"/> 321 | </Table> 322 | </Property> 323 | <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 324 | <TableColumnModel selectionModel="0"> 325 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 326 | <Title/> 327 | <Editor/> 328 | <Renderer/> 329 | </Column> 330 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 331 | <Title/> 332 | <Editor/> 333 | <Renderer/> 334 | </Column> 335 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 336 | <Title/> 337 | <Editor/> 338 | <Renderer/> 339 | </Column> 340 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 341 | <Title/> 342 | <Editor/> 343 | <Renderer/> 344 | </Column> 345 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 346 | <Title/> 347 | <Editor/> 348 | <Renderer/> 349 | </Column> 350 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 351 | <Title/> 352 | <Editor/> 353 | <Renderer/> 354 | </Column> 355 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 356 | <Title/> 357 | <Editor/> 358 | <Renderer/> 359 | </Column> 360 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 361 | <Title/> 362 | <Editor/> 363 | <Renderer/> 364 | </Column> 365 | </TableColumnModel> 366 | </Property> 367 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 368 | <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 369 | </Property> 370 | </Properties> 371 | <Events> 372 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="empolyeeTableMouseClicked"/> 373 | </Events> 374 | </Component> 375 | </SubComponents> 376 | </Container> 377 | </SubComponents> 378 | </Container> 379 | </SubComponents> 380 | </Form> 381 | -------------------------------------------------------------------------------- /src/gui/suppllerRegister.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 4 | <NonVisualComponents> 5 | <Container class="javax.swing.JPanel" name="jPanel3"> 6 | 7 | <Layout> 8 | <DimensionLayout dim="0"> 9 | <Group type="103" groupAlignment="0" attributes="0"> 10 | <EmptySpace min="0" pref="100" max="32767" attributes="0"/> 11 | </Group> 12 | </DimensionLayout> 13 | <DimensionLayout dim="1"> 14 | <Group type="103" groupAlignment="0" attributes="0"> 15 | <EmptySpace min="0" pref="100" max="32767" attributes="0"/> 16 | </Group> 17 | </DimensionLayout> 18 | </Layout> 19 | </Container> 20 | </NonVisualComponents> 21 | <Properties> 22 | <Property name="defaultCloseOperation" type="int" value="2"/> 23 | </Properties> 24 | <SyntheticProperties> 25 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 26 | <SyntheticProperty name="generateCenter" type="boolean" value="true"/> 27 | </SyntheticProperties> 28 | <AuxValues> 29 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 30 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 31 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 32 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 33 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 34 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 35 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 36 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 37 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 38 | </AuxValues> 39 | 40 | <Layout> 41 | <DimensionLayout dim="0"> 42 | <Group type="103" groupAlignment="0" attributes="0"> 43 | <Group type="102" alignment="0" attributes="0"> 44 | <Component id="jPanel1" min="-2" max="-2" attributes="0"/> 45 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 46 | </Group> 47 | </Group> 48 | </DimensionLayout> 49 | <DimensionLayout dim="1"> 50 | <Group type="103" groupAlignment="0" attributes="0"> 51 | <Group type="102" alignment="0" attributes="0"> 52 | <Component id="jPanel1" min="-2" max="-2" attributes="0"/> 53 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 54 | </Group> 55 | </Group> 56 | </DimensionLayout> 57 | </Layout> 58 | <SubComponents> 59 | <Container class="javax.swing.JPanel" name="jPanel1"> 60 | 61 | <Layout> 62 | <DimensionLayout dim="0"> 63 | <Group type="103" groupAlignment="0" attributes="0"> 64 | <Group type="102" alignment="1" attributes="0"> 65 | <Component id="jPanel2" max="32767" attributes="0"/> 66 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 67 | <Group type="103" groupAlignment="0" attributes="0"> 68 | <Component id="jPanel4" min="-2" max="-2" attributes="0"/> 69 | <Component id="jScrollPane1" min="-2" pref="524" max="-2" attributes="0"/> 70 | </Group> 71 | <EmptySpace max="-2" attributes="0"/> 72 | </Group> 73 | </Group> 74 | </DimensionLayout> 75 | <DimensionLayout dim="1"> 76 | <Group type="103" groupAlignment="0" attributes="0"> 77 | <Component id="jPanel2" max="32767" attributes="0"/> 78 | <Group type="102" attributes="0"> 79 | <Component id="jPanel4" min="-2" max="-2" attributes="0"/> 80 | <EmptySpace type="unrelated" max="-2" attributes="0"/> 81 | <Component id="jScrollPane1" pref="0" max="32767" attributes="0"/> 82 | <EmptySpace max="-2" attributes="0"/> 83 | </Group> 84 | </Group> 85 | </DimensionLayout> 86 | </Layout> 87 | <SubComponents> 88 | <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 89 | <AuxValues> 90 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 91 | </AuxValues> 92 | 93 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 94 | <SubComponents> 95 | <Component class="javax.swing.JTable" name="jTable1"> 96 | <Properties> 97 | <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 98 | <Table columnCount="5" rowCount="0"> 99 | <Column editable="false" title="Mobile" type="java.lang.Object"/> 100 | <Column editable="false" title="First Name" type="java.lang.Object"/> 101 | <Column editable="false" title="Last Name" type="java.lang.Object"/> 102 | <Column editable="false" title="Email" type="java.lang.Object"/> 103 | <Column editable="false" title="Company" type="java.lang.Object"/> 104 | </Table> 105 | </Property> 106 | <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 107 | <TableColumnModel selectionModel="0"> 108 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 109 | <Title/> 110 | <Editor/> 111 | <Renderer/> 112 | </Column> 113 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 114 | <Title/> 115 | <Editor/> 116 | <Renderer/> 117 | </Column> 118 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 119 | <Title/> 120 | <Editor/> 121 | <Renderer/> 122 | </Column> 123 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 124 | <Title/> 125 | <Editor/> 126 | <Renderer/> 127 | </Column> 128 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 129 | <Title/> 130 | <Editor/> 131 | <Renderer/> 132 | </Column> 133 | </TableColumnModel> 134 | </Property> 135 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 136 | <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 137 | </Property> 138 | </Properties> 139 | <Events> 140 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTable1MouseClicked"/> 141 | </Events> 142 | </Component> 143 | </SubComponents> 144 | </Container> 145 | <Container class="javax.swing.JPanel" name="jPanel2"> 146 | 147 | <Layout> 148 | <DimensionLayout dim="0"> 149 | <Group type="103" groupAlignment="0" attributes="0"> 150 | <Group type="102" alignment="1" attributes="0"> 151 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 152 | <Group type="103" groupAlignment="1" attributes="0"> 153 | <Component id="jButton3" max="32767" attributes="0"/> 154 | <Component id="jButton2" alignment="0" max="32767" attributes="0"/> 155 | <Group type="102" attributes="0"> 156 | <Group type="103" groupAlignment="0" attributes="0"> 157 | <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> 158 | <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> 159 | </Group> 160 | <EmptySpace min="-2" pref="7" max="-2" attributes="0"/> 161 | <Group type="103" groupAlignment="0" attributes="0"> 162 | <Component id="jTextField4" pref="169" max="32767" attributes="0"/> 163 | <Component id="jTextField5" max="32767" attributes="0"/> 164 | </Group> 165 | </Group> 166 | <Group type="102" attributes="0"> 167 | <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 168 | <EmptySpace max="-2" attributes="0"/> 169 | <Component id="jTextField3" max="32767" attributes="0"/> 170 | </Group> 171 | <Group type="102" attributes="0"> 172 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 173 | <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> 174 | <Component id="jTextField2" max="32767" attributes="0"/> 175 | </Group> 176 | <Component id="jTextField1" max="32767" attributes="0"/> 177 | <Component id="jButton1" max="32767" attributes="0"/> 178 | </Group> 179 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 180 | </Group> 181 | </Group> 182 | </DimensionLayout> 183 | <DimensionLayout dim="1"> 184 | <Group type="103" groupAlignment="0" attributes="0"> 185 | <Group type="102" alignment="0" attributes="0"> 186 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 187 | <Component id="jButton1" min="-2" pref="35" max="-2" attributes="0"/> 188 | <EmptySpace max="-2" attributes="0"/> 189 | <Component id="jTextField1" min="-2" pref="35" max="-2" attributes="0"/> 190 | <EmptySpace max="-2" attributes="0"/> 191 | <Group type="103" groupAlignment="3" attributes="0"> 192 | <Component id="jLabel1" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 193 | <Component id="jTextField2" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 194 | </Group> 195 | <EmptySpace max="-2" attributes="0"/> 196 | <Group type="103" groupAlignment="3" attributes="0"> 197 | <Component id="jLabel2" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 198 | <Component id="jTextField3" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 199 | </Group> 200 | <EmptySpace max="-2" attributes="0"/> 201 | <Group type="103" groupAlignment="3" attributes="0"> 202 | <Component id="jLabel3" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 203 | <Component id="jTextField4" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 204 | </Group> 205 | <EmptySpace max="-2" attributes="0"/> 206 | <Group type="103" groupAlignment="3" attributes="0"> 207 | <Component id="jLabel4" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 208 | <Component id="jTextField5" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 209 | </Group> 210 | <EmptySpace max="-2" attributes="0"/> 211 | <Component id="jButton2" min="-2" pref="35" max="-2" attributes="0"/> 212 | <EmptySpace max="-2" attributes="0"/> 213 | <Component id="jButton3" min="-2" pref="35" max="-2" attributes="0"/> 214 | <EmptySpace max="32767" attributes="0"/> 215 | </Group> 216 | </Group> 217 | </DimensionLayout> 218 | </Layout> 219 | <SubComponents> 220 | <Component class="javax.swing.JButton" name="jButton1"> 221 | <Properties> 222 | <Property name="text" type="java.lang.String" value="Select Company"/> 223 | </Properties> 224 | <Events> 225 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> 226 | </Events> 227 | </Component> 228 | <Component class="javax.swing.JTextField" name="jTextField1"> 229 | </Component> 230 | <Component class="javax.swing.JLabel" name="jLabel1"> 231 | <Properties> 232 | <Property name="text" type="java.lang.String" value="Mobile"/> 233 | </Properties> 234 | </Component> 235 | <Component class="javax.swing.JLabel" name="jLabel2"> 236 | <Properties> 237 | <Property name="text" type="java.lang.String" value="First Name"/> 238 | </Properties> 239 | </Component> 240 | <Component class="javax.swing.JLabel" name="jLabel3"> 241 | <Properties> 242 | <Property name="text" type="java.lang.String" value="Last Name"/> 243 | </Properties> 244 | </Component> 245 | <Component class="javax.swing.JLabel" name="jLabel4"> 246 | <Properties> 247 | <Property name="text" type="java.lang.String" value="Email"/> 248 | </Properties> 249 | </Component> 250 | <Component class="javax.swing.JTextField" name="jTextField2"> 251 | <Events> 252 | <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jTextField2KeyReleased"/> 253 | </Events> 254 | </Component> 255 | <Component class="javax.swing.JTextField" name="jTextField3"> 256 | </Component> 257 | <Component class="javax.swing.JTextField" name="jTextField4"> 258 | </Component> 259 | <Component class="javax.swing.JTextField" name="jTextField5"> 260 | </Component> 261 | <Component class="javax.swing.JButton" name="jButton2"> 262 | <Properties> 263 | <Property name="text" type="java.lang.String" value="Create Account"/> 264 | </Properties> 265 | <Events> 266 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> 267 | </Events> 268 | </Component> 269 | <Component class="javax.swing.JButton" name="jButton3"> 270 | <Properties> 271 | <Property name="text" type="java.lang.String" value="Update Account"/> 272 | </Properties> 273 | <Events> 274 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> 275 | </Events> 276 | </Component> 277 | </SubComponents> 278 | </Container> 279 | <Container class="javax.swing.JPanel" name="jPanel4"> 280 | 281 | <Layout> 282 | <DimensionLayout dim="0"> 283 | <Group type="103" groupAlignment="0" attributes="0"> 284 | <Group type="102" alignment="1" attributes="0"> 285 | <EmptySpace max="-2" attributes="0"/> 286 | <Component id="jLabel9" min="-2" max="-2" attributes="0"/> 287 | <EmptySpace max="-2" attributes="0"/> 288 | <Component id="jComboBox1" min="-2" pref="187" max="-2" attributes="0"/> 289 | <EmptySpace max="-2" attributes="0"/> 290 | <Component id="jButton4" min="-2" pref="30" max="-2" attributes="0"/> 291 | <EmptySpace pref="40" max="32767" attributes="0"/> 292 | <Group type="103" groupAlignment="0" attributes="0"> 293 | <Group type="102" alignment="1" attributes="0"> 294 | <Component id="jLabel5" min="-2" max="-2" attributes="0"/> 295 | <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> 296 | </Group> 297 | <Group type="102" alignment="1" attributes="0"> 298 | <Component id="jLabel6" min="-2" max="-2" attributes="0"/> 299 | <EmptySpace type="unrelated" max="-2" attributes="0"/> 300 | </Group> 301 | </Group> 302 | <Group type="103" groupAlignment="0" attributes="0"> 303 | <Component id="jLabel7" min="-2" pref="94" max="-2" attributes="0"/> 304 | <Component id="jLabel8" min="-2" pref="94" max="-2" attributes="0"/> 305 | </Group> 306 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 307 | </Group> 308 | </Group> 309 | </DimensionLayout> 310 | <DimensionLayout dim="1"> 311 | <Group type="103" groupAlignment="0" attributes="0"> 312 | <Group type="102" attributes="0"> 313 | <EmptySpace min="10" pref="10" max="-2" attributes="0"/> 314 | <Group type="103" groupAlignment="0" attributes="0"> 315 | <Group type="102" alignment="0" attributes="0"> 316 | <Group type="103" groupAlignment="3" attributes="0"> 317 | <Component id="jLabel5" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 318 | <Component id="jLabel7" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 319 | </Group> 320 | <EmptySpace max="-2" attributes="0"/> 321 | <Group type="103" groupAlignment="3" attributes="0"> 322 | <Component id="jLabel6" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 323 | <Component id="jLabel8" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 324 | </Group> 325 | </Group> 326 | <Component id="jButton4" alignment="0" min="-2" pref="35" max="-2" attributes="0"/> 327 | <Group type="103" alignment="0" groupAlignment="3" attributes="0"> 328 | <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> 329 | <Component id="jComboBox1" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 330 | </Group> 331 | </Group> 332 | <EmptySpace max="32767" attributes="0"/> 333 | </Group> 334 | </Group> 335 | </DimensionLayout> 336 | </Layout> 337 | <SubComponents> 338 | <Component class="javax.swing.JLabel" name="jLabel5"> 339 | <Properties> 340 | <Property name="text" type="java.lang.String" value="Total GRN"/> 341 | </Properties> 342 | </Component> 343 | <Component class="javax.swing.JLabel" name="jLabel6"> 344 | <Properties> 345 | <Property name="text" type="java.lang.String" value="Panding Payment"/> 346 | </Properties> 347 | </Component> 348 | <Component class="javax.swing.JLabel" name="jLabel7"> 349 | <Properties> 350 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 351 | <Font name="Segoe UI" size="14" style="1"/> 352 | </Property> 353 | <Property name="text" type="java.lang.String" value="0"/> 354 | </Properties> 355 | </Component> 356 | <Component class="javax.swing.JLabel" name="jLabel8"> 357 | <Properties> 358 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 359 | <Font name="Segoe UI" size="14" style="1"/> 360 | </Property> 361 | <Property name="horizontalAlignment" type="int" value="4"/> 362 | <Property name="text" type="java.lang.String" value="0.00"/> 363 | </Properties> 364 | </Component> 365 | <Component class="javax.swing.JLabel" name="jLabel9"> 366 | <Properties> 367 | <Property name="text" type="java.lang.String" value="Sort By"/> 368 | </Properties> 369 | </Component> 370 | <Component class="javax.swing.JComboBox" name="jComboBox1"> 371 | <Properties> 372 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 373 | <StringArray count="5"> 374 | <StringItem index="0" value="Name ASC"/> 375 | <StringItem index="1" value="Name DESC"/> 376 | <StringItem index="2" value="Company Name ASC"/> 377 | <StringItem index="3" value="Company Name DESC"/> 378 | <StringItem index="4" value=" "/> 379 | </StringArray> 380 | </Property> 381 | </Properties> 382 | <Events> 383 | <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="jComboBox1ItemStateChanged"/> 384 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jComboBox1ActionPerformed"/> 385 | </Events> 386 | <AuxValues> 387 | <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 388 | </AuxValues> 389 | </Component> 390 | <Component class="javax.swing.JButton" name="jButton4"> 391 | <Properties> 392 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 393 | <Image iconType="3" name="/img/reload.png"/> 394 | </Property> 395 | </Properties> 396 | <Events> 397 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/> 398 | </Events> 399 | </Component> 400 | </SubComponents> 401 | </Container> 402 | </SubComponents> 403 | </Container> 404 | </SubComponents> 405 | </Form> 406 | -------------------------------------------------------------------------------- /src/gui/customer_register.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="3"/> 6 | </Properties> 7 | <SyntheticProperties> 8 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 9 | <SyntheticProperty name="generateCenter" type="boolean" value="true"/> 10 | </SyntheticProperties> 11 | <AuxValues> 12 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 13 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 14 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 15 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 17 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 18 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 19 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 20 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 21 | </AuxValues> 22 | 23 | <Layout> 24 | <DimensionLayout dim="0"> 25 | <Group type="103" groupAlignment="0" attributes="0"> 26 | <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> 27 | </Group> 28 | </DimensionLayout> 29 | <DimensionLayout dim="1"> 30 | <Group type="103" groupAlignment="0" attributes="0"> 31 | <Group type="102" alignment="0" attributes="0"> 32 | <EmptySpace max="-2" attributes="0"/> 33 | <Component id="jPanel1" min="-2" max="-2" attributes="0"/> 34 | <EmptySpace max="32767" attributes="0"/> 35 | </Group> 36 | </Group> 37 | </DimensionLayout> 38 | </Layout> 39 | <SubComponents> 40 | <Container class="javax.swing.JPanel" name="jPanel1"> 41 | 42 | <Layout> 43 | <DimensionLayout dim="0"> 44 | <Group type="103" groupAlignment="0" attributes="0"> 45 | <Group type="102" alignment="1" attributes="0"> 46 | <Component id="jPanel2" min="-2" max="-2" attributes="0"/> 47 | <EmptySpace max="32767" attributes="0"/> 48 | </Group> 49 | </Group> 50 | </DimensionLayout> 51 | <DimensionLayout dim="1"> 52 | <Group type="103" groupAlignment="0" attributes="0"> 53 | <Group type="102" alignment="0" attributes="0"> 54 | <Component id="jPanel2" min="-2" max="-2" attributes="0"/> 55 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 56 | </Group> 57 | </Group> 58 | </DimensionLayout> 59 | </Layout> 60 | <SubComponents> 61 | <Container class="javax.swing.JPanel" name="jPanel2"> 62 | 63 | <Layout> 64 | <DimensionLayout dim="0"> 65 | <Group type="103" groupAlignment="0" attributes="0"> 66 | <Group type="102" alignment="0" attributes="0"> 67 | <Component id="jPanel3" min="-2" max="-2" attributes="0"/> 68 | <EmptySpace max="-2" attributes="0"/> 69 | <Group type="103" groupAlignment="0" attributes="0"> 70 | <Component id="jPanel4" max="32767" attributes="0"/> 71 | <Group type="102" attributes="0"> 72 | <Component id="jPanel5" max="32767" attributes="0"/> 73 | <EmptySpace max="-2" attributes="0"/> 74 | </Group> 75 | </Group> 76 | </Group> 77 | </Group> 78 | </DimensionLayout> 79 | <DimensionLayout dim="1"> 80 | <Group type="103" groupAlignment="0" attributes="0"> 81 | <Group type="102" attributes="0"> 82 | <Group type="103" groupAlignment="0" attributes="0"> 83 | <Group type="102" attributes="0"> 84 | <Component id="jPanel4" min="-2" max="-2" attributes="0"/> 85 | <EmptySpace max="-2" attributes="0"/> 86 | <Component id="jPanel5" min="-2" max="-2" attributes="0"/> 87 | </Group> 88 | <Component id="jPanel3" alignment="0" min="-2" max="-2" attributes="0"/> 89 | </Group> 90 | <EmptySpace min="0" pref="1" max="32767" attributes="0"/> 91 | </Group> 92 | </Group> 93 | </DimensionLayout> 94 | </Layout> 95 | <SubComponents> 96 | <Container class="javax.swing.JPanel" name="jPanel3"> 97 | 98 | <Layout> 99 | <DimensionLayout dim="0"> 100 | <Group type="103" groupAlignment="0" attributes="0"> 101 | <Group type="102" alignment="0" attributes="0"> 102 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 103 | <Group type="103" groupAlignment="1" max="-2" attributes="0"> 104 | <Component id="jButton1" max="32767" attributes="0"/> 105 | <Group type="102" alignment="0" attributes="0"> 106 | <Group type="103" groupAlignment="0" attributes="0"> 107 | <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> 108 | <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> 109 | </Group> 110 | <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> 111 | <Group type="103" groupAlignment="0" attributes="0"> 112 | <Component id="jTextField3" pref="219" max="32767" attributes="0"/> 113 | <Component id="jTextField4" max="32767" attributes="0"/> 114 | </Group> 115 | </Group> 116 | <Component id="jButton2" max="32767" attributes="0"/> 117 | <Group type="102" alignment="0" attributes="0"> 118 | <Group type="103" groupAlignment="0" attributes="0"> 119 | <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> 120 | <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> 121 | </Group> 122 | <EmptySpace type="unrelated" max="-2" attributes="0"/> 123 | <Group type="103" groupAlignment="0" attributes="0"> 124 | <Component id="jTextField1" max="32767" attributes="0"/> 125 | <Component id="jTextField2" max="32767" attributes="0"/> 126 | </Group> 127 | </Group> 128 | </Group> 129 | <EmptySpace pref="10" max="32767" attributes="0"/> 130 | </Group> 131 | </Group> 132 | </DimensionLayout> 133 | <DimensionLayout dim="1"> 134 | <Group type="103" groupAlignment="0" attributes="0"> 135 | <Group type="102" alignment="0" attributes="0"> 136 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 137 | <Group type="103" groupAlignment="3" attributes="0"> 138 | <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> 139 | <Component id="jTextField1" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 140 | </Group> 141 | <EmptySpace max="-2" attributes="0"/> 142 | <Group type="103" groupAlignment="3" attributes="0"> 143 | <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> 144 | <Component id="jTextField2" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 145 | </Group> 146 | <EmptySpace max="-2" attributes="0"/> 147 | <Group type="103" groupAlignment="3" attributes="0"> 148 | <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> 149 | <Component id="jTextField3" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 150 | </Group> 151 | <EmptySpace max="-2" attributes="0"/> 152 | <Group type="103" groupAlignment="3" attributes="0"> 153 | <Component id="jTextField4" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 154 | <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> 155 | </Group> 156 | <EmptySpace type="unrelated" max="-2" attributes="0"/> 157 | <Component id="jButton1" min="-2" pref="35" max="-2" attributes="0"/> 158 | <EmptySpace max="-2" attributes="0"/> 159 | <Component id="jButton2" min="-2" pref="35" max="-2" attributes="0"/> 160 | <EmptySpace pref="10" max="32767" attributes="0"/> 161 | </Group> 162 | </Group> 163 | </DimensionLayout> 164 | </Layout> 165 | <SubComponents> 166 | <Component class="javax.swing.JLabel" name="jLabel1"> 167 | <Properties> 168 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 169 | <Font name="Segoe UI" size="14" style="0"/> 170 | </Property> 171 | <Property name="text" type="java.lang.String" value="Mobile"/> 172 | </Properties> 173 | </Component> 174 | <Component class="javax.swing.JLabel" name="jLabel2"> 175 | <Properties> 176 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 177 | <Font name="Segoe UI" size="14" style="0"/> 178 | </Property> 179 | <Property name="text" type="java.lang.String" value="First Name"/> 180 | </Properties> 181 | </Component> 182 | <Component class="javax.swing.JLabel" name="jLabel3"> 183 | <Properties> 184 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 185 | <Font name="Segoe UI" size="14" style="0"/> 186 | </Property> 187 | <Property name="text" type="java.lang.String" value="Last Name"/> 188 | </Properties> 189 | </Component> 190 | <Component class="javax.swing.JLabel" name="jLabel4"> 191 | <Properties> 192 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 193 | <Font name="Segoe UI" size="14" style="0"/> 194 | </Property> 195 | <Property name="text" type="java.lang.String" value="Email"/> 196 | </Properties> 197 | </Component> 198 | <Component class="javax.swing.JTextField" name="jTextField1"> 199 | <Events> 200 | <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jTextField1KeyReleased"/> 201 | </Events> 202 | </Component> 203 | <Component class="javax.swing.JTextField" name="jTextField2"> 204 | </Component> 205 | <Component class="javax.swing.JTextField" name="jTextField3"> 206 | <Events> 207 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField3ActionPerformed"/> 208 | </Events> 209 | </Component> 210 | <Component class="javax.swing.JTextField" name="jTextField4"> 211 | </Component> 212 | <Component class="javax.swing.JButton" name="jButton1"> 213 | <Properties> 214 | <Property name="text" type="java.lang.String" value="Create Account"/> 215 | </Properties> 216 | <Events> 217 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> 218 | </Events> 219 | </Component> 220 | <Component class="javax.swing.JButton" name="jButton2"> 221 | <Properties> 222 | <Property name="text" type="java.lang.String" value="Update Account"/> 223 | </Properties> 224 | <Events> 225 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> 226 | </Events> 227 | </Component> 228 | </SubComponents> 229 | </Container> 230 | <Container class="javax.swing.JPanel" name="jPanel4"> 231 | 232 | <Layout> 233 | <DimensionLayout dim="0"> 234 | <Group type="103" groupAlignment="0" attributes="0"> 235 | <Group type="102" alignment="0" attributes="0"> 236 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 237 | <Component id="jLabel5" min="-2" max="-2" attributes="0"/> 238 | <EmptySpace max="-2" attributes="0"/> 239 | <Component id="jComboBox1" min="-2" pref="187" max="-2" attributes="0"/> 240 | <EmptySpace max="-2" attributes="0"/> 241 | <Component id="jButton3" min="-2" pref="30" max="-2" attributes="0"/> 242 | <EmptySpace pref="142" max="32767" attributes="0"/> 243 | <Component id="jLabel6" min="-2" max="-2" attributes="0"/> 244 | <EmptySpace max="-2" attributes="0"/> 245 | <Component id="jTextField5" min="-2" pref="144" max="-2" attributes="0"/> 246 | <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> 247 | </Group> 248 | </Group> 249 | </DimensionLayout> 250 | <DimensionLayout dim="1"> 251 | <Group type="103" groupAlignment="0" attributes="0"> 252 | <Group type="102" alignment="0" attributes="0"> 253 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 254 | <Group type="103" groupAlignment="0" attributes="0"> 255 | <Component id="jButton3" alignment="0" min="-2" pref="35" max="-2" attributes="0"/> 256 | <Group type="103" groupAlignment="3" attributes="0"> 257 | <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> 258 | <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> 259 | <Component id="jTextField5" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 260 | <Component id="jComboBox1" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> 261 | </Group> 262 | </Group> 263 | <EmptySpace max="32767" attributes="0"/> 264 | </Group> 265 | </Group> 266 | </DimensionLayout> 267 | </Layout> 268 | <SubComponents> 269 | <Component class="javax.swing.JLabel" name="jLabel5"> 270 | <Properties> 271 | <Property name="text" type="java.lang.String" value="Sort By"/> 272 | </Properties> 273 | </Component> 274 | <Component class="javax.swing.JComboBox" name="jComboBox1"> 275 | <Properties> 276 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 277 | <StringArray count="4"> 278 | <StringItem index="0" value="Name ASC"/> 279 | <StringItem index="1" value="Name DESC"/> 280 | <StringItem index="2" value="Points ASC"/> 281 | <StringItem index="3" value="Points DESC"/> 282 | </StringArray> 283 | </Property> 284 | </Properties> 285 | <Events> 286 | <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="jComboBox1ItemStateChanged"/> 287 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jComboBox1ActionPerformed"/> 288 | </Events> 289 | <AuxValues> 290 | <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 291 | </AuxValues> 292 | </Component> 293 | <Component class="javax.swing.JLabel" name="jLabel6"> 294 | <Properties> 295 | <Property name="text" type="java.lang.String" value="Total Invoices"/> 296 | </Properties> 297 | </Component> 298 | <Component class="javax.swing.JTextField" name="jTextField5"> 299 | </Component> 300 | <Component class="javax.swing.JButton" name="jButton3"> 301 | <Properties> 302 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 303 | <Image iconType="3" name="/img/reload.png"/> 304 | </Property> 305 | </Properties> 306 | <Events> 307 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> 308 | </Events> 309 | </Component> 310 | </SubComponents> 311 | </Container> 312 | <Container class="javax.swing.JPanel" name="jPanel5"> 313 | 314 | <Layout> 315 | <DimensionLayout dim="0"> 316 | <Group type="103" groupAlignment="0" attributes="0"> 317 | <Group type="102" alignment="0" attributes="0"> 318 | <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> 319 | <Component id="jScrollPane2" max="32767" attributes="0"/> 320 | <EmptySpace max="-2" attributes="0"/> 321 | </Group> 322 | </Group> 323 | </DimensionLayout> 324 | <DimensionLayout dim="1"> 325 | <Group type="103" groupAlignment="0" attributes="0"> 326 | <Group type="102" alignment="0" attributes="0"> 327 | <EmptySpace max="-2" attributes="0"/> 328 | <Component id="jScrollPane2" min="-2" pref="193" max="-2" attributes="0"/> 329 | <EmptySpace pref="10" max="32767" attributes="0"/> 330 | </Group> 331 | </Group> 332 | </DimensionLayout> 333 | </Layout> 334 | <SubComponents> 335 | <Container class="javax.swing.JScrollPane" name="jScrollPane2"> 336 | <AuxValues> 337 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 338 | </AuxValues> 339 | 340 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 341 | <SubComponents> 342 | <Component class="javax.swing.JTable" name="jTable2"> 343 | <Properties> 344 | <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 345 | <Table columnCount="5" rowCount="0"> 346 | <Column editable="false" title="Mobile" type="java.lang.Object"/> 347 | <Column editable="false" title="First Name" type="java.lang.Object"/> 348 | <Column editable="false" title="Last Name" type="java.lang.Object"/> 349 | <Column editable="false" title="Email" type="java.lang.Object"/> 350 | <Column editable="false" title="Porint" type="java.lang.Object"/> 351 | </Table> 352 | </Property> 353 | <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 354 | <TableColumnModel selectionModel="0"> 355 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 356 | <Title/> 357 | <Editor/> 358 | <Renderer/> 359 | </Column> 360 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 361 | <Title/> 362 | <Editor/> 363 | <Renderer/> 364 | </Column> 365 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 366 | <Title/> 367 | <Editor/> 368 | <Renderer/> 369 | </Column> 370 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 371 | <Title/> 372 | <Editor/> 373 | <Renderer/> 374 | </Column> 375 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 376 | <Title/> 377 | <Editor/> 378 | <Renderer/> 379 | </Column> 380 | </TableColumnModel> 381 | </Property> 382 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 383 | <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 384 | </Property> 385 | </Properties> 386 | <Events> 387 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jTable2MouseClicked"/> 388 | </Events> 389 | </Component> 390 | </SubComponents> 391 | </Container> 392 | </SubComponents> 393 | </Container> 394 | </SubComponents> 395 | </Container> 396 | </SubComponents> 397 | </Container> 398 | </SubComponents> 399 | </Form> 400 | -------------------------------------------------------------------------------- /src/gui/customer_register.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license 3 | * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template 4 | */ 5 | package gui; 6 | 7 | import com.formdev.flatlaf.themes.FlatMacDarkLaf; 8 | import java.sql.ResultSet; 9 | import java.util.Vector; 10 | import javax.swing.JOptionPane; 11 | import javax.swing.table.DefaultTableModel; 12 | import model.MySQL; 13 | 14 | /** 15 | * 16 | * @author user 17 | */ 18 | public class customer_register extends javax.swing.JFrame { 19 | 20 | private invoice Invoice; 21 | 22 | public void setInvoice(invoice Invoice) { 23 | this.Invoice = Invoice; 24 | } 25 | 26 | public customer_register() { 27 | initComponents(); 28 | loadCustomer("first_name", "ASC", "0"); 29 | } 30 | 31 | private void loadCustomer(String column, String method, String mobile) { 32 | 33 | try { 34 | ResultSet resultSet = MySQL.execute("SELECT * FROM `customer` WHERE `mobile` LIKE '" + mobile + "%' ORDER BY `" + column + "` " + method + ""); 35 | 36 | DefaultTableModel table = (DefaultTableModel) jTable2.getModel(); 37 | table.setRowCount(0); 38 | 39 | while (resultSet.next()) { 40 | 41 | Vector<String> vector = new Vector<>(); 42 | vector.add(resultSet.getString("mobile")); 43 | vector.add(resultSet.getString("first_name")); 44 | vector.add(resultSet.getString("last_name")); 45 | vector.add(resultSet.getString("email")); 46 | vector.add(resultSet.getString("points")); 47 | 48 | table.addRow(vector); 49 | 50 | } 51 | 52 | } catch (Exception e) { 53 | e.printStackTrace(); 54 | } 55 | 56 | } 57 | 58 | private void reset() { 59 | 60 | jTextField1.setText(""); 61 | jTextField1.setEditable(true); 62 | jTextField2.setText(""); 63 | jTextField3.setText(""); 64 | jTextField4.setText(""); 65 | jTextField5.setText(""); 66 | jComboBox1.setSelectedIndex(0); 67 | jTable2.clearSelection(); 68 | jTextField1.grabFocus(); 69 | jButton1.setEnabled(true); 70 | 71 | } 72 | 73 | private void search() { 74 | 75 | int sortIndex = jComboBox1.getSelectedIndex(); 76 | 77 | if (sortIndex == 0) { 78 | loadCustomer("first_name", "ASC", jTextField1.getText()); 79 | } else if (sortIndex == 1) { 80 | loadCustomer("first_name", "DESC", jTextField1.getText()); 81 | } else if (sortIndex == 2) { 82 | loadCustomer("points", "ASC", jTextField1.getText()); 83 | } else if (sortIndex == 3) { 84 | loadCustomer("points", "DESC", jTextField1.getText()); 85 | } 86 | 87 | } 88 | 89 | /** 90 | * This method is called from within the constructor to initialize the form. 91 | * WARNING: Do NOT modify this code. The content of this method is always 92 | * regenerated by the Form Editor. 93 | */ 94 | @SuppressWarnings("unchecked") 95 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 96 | private void initComponents() { 97 | 98 | jPanel1 = new javax.swing.JPanel(); 99 | jPanel2 = new javax.swing.JPanel(); 100 | jPanel3 = new javax.swing.JPanel(); 101 | jLabel1 = new javax.swing.JLabel(); 102 | jLabel2 = new javax.swing.JLabel(); 103 | jLabel3 = new javax.swing.JLabel(); 104 | jLabel4 = new javax.swing.JLabel(); 105 | jTextField1 = new javax.swing.JTextField(); 106 | jTextField2 = new javax.swing.JTextField(); 107 | jTextField3 = new javax.swing.JTextField(); 108 | jTextField4 = new javax.swing.JTextField(); 109 | jButton1 = new javax.swing.JButton(); 110 | jButton2 = new javax.swing.JButton(); 111 | jPanel4 = new javax.swing.JPanel(); 112 | jLabel5 = new javax.swing.JLabel(); 113 | jComboBox1 = new javax.swing.JComboBox<>(); 114 | jLabel6 = new javax.swing.JLabel(); 115 | jTextField5 = new javax.swing.JTextField(); 116 | jButton3 = new javax.swing.JButton(); 117 | jPanel5 = new javax.swing.JPanel(); 118 | jScrollPane2 = new javax.swing.JScrollPane(); 119 | jTable2 = new javax.swing.JTable(); 120 | 121 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 122 | 123 | jLabel1.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N 124 | jLabel1.setText("Mobile"); 125 | 126 | jLabel2.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N 127 | jLabel2.setText("First Name"); 128 | 129 | jLabel3.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N 130 | jLabel3.setText("Last Name"); 131 | 132 | jLabel4.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N 133 | jLabel4.setText("Email"); 134 | 135 | jTextField1.addKeyListener(new java.awt.event.KeyAdapter() { 136 | public void keyReleased(java.awt.event.KeyEvent evt) { 137 | jTextField1KeyReleased(evt); 138 | } 139 | }); 140 | 141 | jTextField3.addActionListener(new java.awt.event.ActionListener() { 142 | public void actionPerformed(java.awt.event.ActionEvent evt) { 143 | jTextField3ActionPerformed(evt); 144 | } 145 | }); 146 | 147 | jButton1.setText("Create Account"); 148 | jButton1.addActionListener(new java.awt.event.ActionListener() { 149 | public void actionPerformed(java.awt.event.ActionEvent evt) { 150 | jButton1ActionPerformed(evt); 151 | } 152 | }); 153 | 154 | jButton2.setText("Update Account"); 155 | jButton2.addActionListener(new java.awt.event.ActionListener() { 156 | public void actionPerformed(java.awt.event.ActionEvent evt) { 157 | jButton2ActionPerformed(evt); 158 | } 159 | }); 160 | 161 | javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); 162 | jPanel3.setLayout(jPanel3Layout); 163 | jPanel3Layout.setHorizontalGroup( 164 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 165 | .addGroup(jPanel3Layout.createSequentialGroup() 166 | .addGap(10, 10, 10) 167 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 168 | .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 169 | .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() 170 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 171 | .addComponent(jLabel3) 172 | .addComponent(jLabel4)) 173 | .addGap(13, 13, 13) 174 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 175 | .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE) 176 | .addComponent(jTextField4))) 177 | .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 178 | .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() 179 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 180 | .addComponent(jLabel2) 181 | .addComponent(jLabel1)) 182 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 183 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 184 | .addComponent(jTextField1) 185 | .addComponent(jTextField2)))) 186 | .addContainerGap(10, Short.MAX_VALUE)) 187 | ); 188 | jPanel3Layout.setVerticalGroup( 189 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 190 | .addGroup(jPanel3Layout.createSequentialGroup() 191 | .addGap(10, 10, 10) 192 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 193 | .addComponent(jLabel1) 194 | .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) 195 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 196 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 197 | .addComponent(jLabel2) 198 | .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) 199 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 200 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 201 | .addComponent(jLabel3) 202 | .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) 203 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 204 | .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 205 | .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 206 | .addComponent(jLabel4)) 207 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 208 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 209 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 210 | .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 211 | .addContainerGap(10, Short.MAX_VALUE)) 212 | ); 213 | 214 | jLabel5.setText("Sort By"); 215 | 216 | jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Name ASC", "Name DESC", "Points ASC", "Points DESC" })); 217 | jComboBox1.addItemListener(new java.awt.event.ItemListener() { 218 | public void itemStateChanged(java.awt.event.ItemEvent evt) { 219 | jComboBox1ItemStateChanged(evt); 220 | } 221 | }); 222 | jComboBox1.addActionListener(new java.awt.event.ActionListener() { 223 | public void actionPerformed(java.awt.event.ActionEvent evt) { 224 | jComboBox1ActionPerformed(evt); 225 | } 226 | }); 227 | 228 | jLabel6.setText("Total Invoices"); 229 | 230 | jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/reload.png"))); // NOI18N 231 | jButton3.addActionListener(new java.awt.event.ActionListener() { 232 | public void actionPerformed(java.awt.event.ActionEvent evt) { 233 | jButton3ActionPerformed(evt); 234 | } 235 | }); 236 | 237 | javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); 238 | jPanel4.setLayout(jPanel4Layout); 239 | jPanel4Layout.setHorizontalGroup( 240 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 241 | .addGroup(jPanel4Layout.createSequentialGroup() 242 | .addGap(10, 10, 10) 243 | .addComponent(jLabel5) 244 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 245 | .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE) 246 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 247 | .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 248 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 142, Short.MAX_VALUE) 249 | .addComponent(jLabel6) 250 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 251 | .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE) 252 | .addGap(15, 15, 15)) 253 | ); 254 | jPanel4Layout.setVerticalGroup( 255 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 256 | .addGroup(jPanel4Layout.createSequentialGroup() 257 | .addGap(10, 10, 10) 258 | .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 259 | .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 260 | .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 261 | .addComponent(jLabel5) 262 | .addComponent(jLabel6) 263 | .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) 264 | .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))) 265 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 266 | ); 267 | 268 | jTable2.setModel(new javax.swing.table.DefaultTableModel( 269 | new Object [][] { 270 | 271 | }, 272 | new String [] { 273 | "Mobile", "First Name", "Last Name", "Email", "Porint" 274 | } 275 | ) { 276 | boolean[] canEdit = new boolean [] { 277 | false, false, false, false, false 278 | }; 279 | 280 | public boolean isCellEditable(int rowIndex, int columnIndex) { 281 | return canEdit [columnIndex]; 282 | } 283 | }); 284 | jTable2.addMouseListener(new java.awt.event.MouseAdapter() { 285 | public void mouseClicked(java.awt.event.MouseEvent evt) { 286 | jTable2MouseClicked(evt); 287 | } 288 | }); 289 | jScrollPane2.setViewportView(jTable2); 290 | 291 | javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); 292 | jPanel5.setLayout(jPanel5Layout); 293 | jPanel5Layout.setHorizontalGroup( 294 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 295 | .addGroup(jPanel5Layout.createSequentialGroup() 296 | .addGap(10, 10, 10) 297 | .addComponent(jScrollPane2) 298 | .addContainerGap()) 299 | ); 300 | jPanel5Layout.setVerticalGroup( 301 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 302 | .addGroup(jPanel5Layout.createSequentialGroup() 303 | .addContainerGap() 304 | .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE) 305 | .addContainerGap(10, Short.MAX_VALUE)) 306 | ); 307 | 308 | javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); 309 | jPanel2.setLayout(jPanel2Layout); 310 | jPanel2Layout.setHorizontalGroup( 311 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 312 | .addGroup(jPanel2Layout.createSequentialGroup() 313 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 314 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 315 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 316 | .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 317 | .addGroup(jPanel2Layout.createSequentialGroup() 318 | .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 319 | .addContainerGap()))) 320 | ); 321 | jPanel2Layout.setVerticalGroup( 322 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 323 | .addGroup(jPanel2Layout.createSequentialGroup() 324 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 325 | .addGroup(jPanel2Layout.createSequentialGroup() 326 | .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 327 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 328 | .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 329 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 330 | .addGap(0, 1, Short.MAX_VALUE)) 331 | ); 332 | 333 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 334 | jPanel1.setLayout(jPanel1Layout); 335 | jPanel1Layout.setHorizontalGroup( 336 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 337 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 338 | .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 339 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 340 | ); 341 | jPanel1Layout.setVerticalGroup( 342 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 343 | .addGroup(jPanel1Layout.createSequentialGroup() 344 | .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 345 | .addGap(0, 0, Short.MAX_VALUE)) 346 | ); 347 | 348 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 349 | getContentPane().setLayout(layout); 350 | layout.setHorizontalGroup( 351 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 352 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 353 | ); 354 | layout.setVerticalGroup( 355 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 356 | .addGroup(layout.createSequentialGroup() 357 | .addContainerGap() 358 | .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 359 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 360 | ); 361 | 362 | pack(); 363 | setLocationRelativeTo(null); 364 | }// </editor-fold>//GEN-END:initComponents 365 | 366 | private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed 367 | // TODO add your handling code here: 368 | }//GEN-LAST:event_jTextField3ActionPerformed 369 | 370 | private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed 371 | // TODO add your handling code here: 372 | }//GEN-LAST:event_jComboBox1ActionPerformed 373 | 374 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 375 | // TODO add your handling code here: 376 | 377 | String mobile = jTextField1.getText(); 378 | String fname = jTextField2.getText(); 379 | String lname = jTextField3.getText(); 380 | String email = jTextField4.getText(); 381 | 382 | if (mobile.isEmpty()) { 383 | JOptionPane.showMessageDialog(this, "Type your Mobile ", "warning", JOptionPane.INFORMATION_MESSAGE); 384 | } else if (!mobile.matches("^07[01245678]{1}[0-9]{7}$")) { 385 | JOptionPane.showMessageDialog(this, "Invalid Mobile ", "warning", JOptionPane.INFORMATION_MESSAGE); 386 | } else if (fname.isEmpty()) { 387 | JOptionPane.showMessageDialog(this, "Type your First Name ", "warning", JOptionPane.INFORMATION_MESSAGE); 388 | } else if (lname.isEmpty()) { 389 | JOptionPane.showMessageDialog(this, "Type your Last Name ", "warning", JOptionPane.INFORMATION_MESSAGE); 390 | } else if (email.isEmpty()) { 391 | JOptionPane.showMessageDialog(this, "Type your Email ", "warning", JOptionPane.INFORMATION_MESSAGE); 392 | } else if (!email.matches("^(?=.{1,64}@)[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*@" 393 | + "[^-][A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$")) { 394 | JOptionPane.showMessageDialog(this, "Invalid Email Address", "warning", JOptionPane.INFORMATION_MESSAGE); 395 | } else { 396 | 397 | try { 398 | ResultSet resultset = MySQL.execute("SELECT * FROM `customer` WHERE `mobile`='" + mobile + "' OR `email`='" + email + "'"); 399 | 400 | if (resultset.next()) { 401 | JOptionPane.showMessageDialog(this, "Customer already Registerted", "warning", JOptionPane.INFORMATION_MESSAGE); 402 | } else { 403 | 404 | MySQL.execute("INSERT INTO `customer`(`mobile`,`first_name`,`last_name`,`email`,`points`)VALUES('" + mobile + "','" + fname + "','" + lname + "','" + email + "','0')"); 405 | loadCustomer("first_name", "ASC", "0"); 406 | reset(); 407 | } 408 | 409 | } catch (Exception e) { 410 | e.printStackTrace(); 411 | } 412 | 413 | } 414 | }//GEN-LAST:event_jButton1ActionPerformed 415 | 416 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed 417 | // TODO add your handling code here: 418 | 419 | reset(); 420 | loadCustomer("first_name", "ASC", "0"); 421 | 422 | 423 | }//GEN-LAST:event_jButton3ActionPerformed 424 | 425 | private void jTable2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable2MouseClicked 426 | // TODO add your handling code here: 427 | 428 | int row = jTable2.getSelectedRow(); 429 | 430 | String mobile = String.valueOf(jTable2.getValueAt(row, 0)); 431 | jTextField1.setText(mobile); 432 | jTextField1.setEditable(false); 433 | 434 | String fname = String.valueOf(jTable2.getValueAt(row, 1)); 435 | jTextField2.setText(fname); 436 | 437 | String lname = String.valueOf(jTable2.getValueAt(row, 2)); 438 | jTextField3.setText(lname); 439 | 440 | String email = String.valueOf(jTable2.getValueAt(row, 3)); 441 | jTextField4.setText(email); 442 | 443 | jButton1.setEnabled(false); 444 | 445 | if (evt.getClickCount() == 2) { 446 | if (Invoice != null) { 447 | Invoice.getjTextField2().setText(String.valueOf(jTable2.getValueAt(row, 0))); 448 | Invoice.getjLabel3().setText(String.valueOf(jTable2.getValueAt(row, 1) + " " + String.valueOf(jTable2.getValueAt(row, 2)))); 449 | Invoice.getjLabel24().setText(String.valueOf(jTable2.getValueAt(row, 4))); 450 | this.dispose(); 451 | } 452 | } 453 | 454 | try { 455 | ResultSet resultSet = MySQL.execute("SELECT * FROM `invoice` WHERE `customer_mobile`='" + mobile + "'"); 456 | 457 | if (resultSet.next()) { 458 | 459 | String count = resultSet.getString(1); 460 | jTextField5.setText(count); 461 | 462 | } 463 | } catch (Exception e) { 464 | e.printStackTrace(); 465 | } 466 | 467 | 468 | }//GEN-LAST:event_jTable2MouseClicked 469 | 470 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed 471 | // TODO add your handling code here: 472 | 473 | String mobile = jTextField1.getText(); 474 | String fname = jTextField2.getText(); 475 | String lname = jTextField3.getText(); 476 | String email = jTextField4.getText(); 477 | 478 | if (fname.isEmpty()) { 479 | JOptionPane.showMessageDialog(this, "Type your First Name ", "warning", JOptionPane.INFORMATION_MESSAGE); 480 | } else if (lname.isEmpty()) { 481 | JOptionPane.showMessageDialog(this, "Type your Last Name ", "warning", JOptionPane.INFORMATION_MESSAGE); 482 | } else if (email.isEmpty()) { 483 | JOptionPane.showMessageDialog(this, "Type your Email ", "warning", JOptionPane.INFORMATION_MESSAGE); 484 | } else if (!email.matches("^(?=.{1,64}@)[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*@" 485 | + "[^-][A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$")) { 486 | JOptionPane.showMessageDialog(this, "Invalid Email Address", "warning", JOptionPane.INFORMATION_MESSAGE); 487 | } else { 488 | 489 | try { 490 | 491 | boolean isFound = false; 492 | 493 | ResultSet resultset = MySQL.execute("SELECT * FROM `customer` WHERE `email`='" + email + "'"); 494 | 495 | if (resultset.next()) { 496 | 497 | if (resultset.getString("mobile").equals(mobile)) { 498 | isFound = true; 499 | } else { 500 | JOptionPane.showMessageDialog(this, "Email already Use", "warning", JOptionPane.INFORMATION_MESSAGE); 501 | } 502 | 503 | } else { 504 | isFound = true; 505 | } 506 | 507 | if (isFound) { 508 | MySQL.execute("UPDATE `customer` SET `first_name`='" + fname + "',`last_name`='" + lname + "',`email`='" + email + "' WHERE `mobile`='" + mobile + "'"); 509 | loadCustomer("first_name", "ASC", "0"); 510 | 511 | reset(); 512 | 513 | } 514 | 515 | } catch (Exception e) { 516 | e.printStackTrace(); 517 | } 518 | 519 | } 520 | 521 | }//GEN-LAST:event_jButton2ActionPerformed 522 | 523 | private void jComboBox1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox1ItemStateChanged 524 | // TODO add your handling code here: 525 | search(); 526 | 527 | }//GEN-LAST:event_jComboBox1ItemStateChanged 528 | 529 | private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased 530 | // TODO add your handling code here: 531 | search(); 532 | }//GEN-LAST:event_jTextField1KeyReleased 533 | 534 | /** 535 | * @param args the command line arguments 536 | */ 537 | public static void main(String args[]) { 538 | FlatMacDarkLaf.setup(); 539 | java.awt.EventQueue.invokeLater(new Runnable() { 540 | public void run() { 541 | new customer_register().setVisible(true); 542 | } 543 | }); 544 | } 545 | 546 | // Variables declaration - do not modify//GEN-BEGIN:variables 547 | private javax.swing.JButton jButton1; 548 | private javax.swing.JButton jButton2; 549 | private javax.swing.JButton jButton3; 550 | private javax.swing.JComboBox<String> jComboBox1; 551 | private javax.swing.JLabel jLabel1; 552 | private javax.swing.JLabel jLabel2; 553 | private javax.swing.JLabel jLabel3; 554 | private javax.swing.JLabel jLabel4; 555 | private javax.swing.JLabel jLabel5; 556 | private javax.swing.JLabel jLabel6; 557 | private javax.swing.JPanel jPanel1; 558 | private javax.swing.JPanel jPanel2; 559 | private javax.swing.JPanel jPanel3; 560 | private javax.swing.JPanel jPanel4; 561 | private javax.swing.JPanel jPanel5; 562 | private javax.swing.JScrollPane jScrollPane2; 563 | private javax.swing.JTable jTable2; 564 | private javax.swing.JTextField jTextField1; 565 | private javax.swing.JTextField jTextField2; 566 | private javax.swing.JTextField jTextField3; 567 | private javax.swing.JTextField jTextField4; 568 | private javax.swing.JTextField jTextField5; 569 | // End of variables declaration//GEN-END:variables 570 | } 571 | --------------------------------------------------------------------------------