├── .gitignore ├── nbproject ├── private │ ├── config.properties │ ├── private.properties │ └── private.xml ├── genfiles.properties ├── project.xml └── project.properties ├── manifest.mf ├── src └── TAMS │ ├── icons8-back-50.png │ ├── icons8-back-to-64.png │ ├── green-mountain-2132180.jpg │ ├── Mysqlconnect.java │ ├── vechicleDisp.java │ ├── NewJFrame.form │ ├── NewJFrame.java │ ├── Login.form │ ├── Login.java │ ├── Home.form │ ├── Home.java │ ├── Employee.form │ ├── Employee.java │ ├── Vechicle.form │ ├── Vechicle.java │ └── Confirm_book.form ├── TAMS-images ├── Screenshot (131).png ├── Screenshot (132).png ├── Screenshot (21).png ├── Screenshot (22).png ├── Screenshot (23).png ├── Screenshot (24).png └── Screenshot (25).png ├── README.html ├── README.md └── TAMS.sql /.gitignore: -------------------------------------------------------------------------------- 1 | /dist/ -------------------------------------------------------------------------------- /nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /src/TAMS/icons8-back-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/src/TAMS/icons8-back-50.png -------------------------------------------------------------------------------- /src/TAMS/icons8-back-to-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/src/TAMS/icons8-back-to-64.png -------------------------------------------------------------------------------- /TAMS-images/Screenshot (131).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/TAMS-images/Screenshot (131).png -------------------------------------------------------------------------------- /TAMS-images/Screenshot (132).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/TAMS-images/Screenshot (132).png -------------------------------------------------------------------------------- /TAMS-images/Screenshot (21).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/TAMS-images/Screenshot (21).png -------------------------------------------------------------------------------- /TAMS-images/Screenshot (22).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/TAMS-images/Screenshot (22).png -------------------------------------------------------------------------------- /TAMS-images/Screenshot (23).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/TAMS-images/Screenshot (23).png -------------------------------------------------------------------------------- /TAMS-images/Screenshot (24).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/TAMS-images/Screenshot (24).png -------------------------------------------------------------------------------- /TAMS-images/Screenshot (25).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/TAMS-images/Screenshot (25).png -------------------------------------------------------------------------------- /src/TAMS/green-mountain-2132180.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praveenhonavar/Travel-Agency-Management-System/HEAD/src/TAMS/green-mountain-2132180.jpg -------------------------------------------------------------------------------- /nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\HP\\AppData\\Roaming\\NetBeans\\11.1\\build.properties 9 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=c2402c51 2 | build.xml.script.CRC32=17763309 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.92.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=c2402c51 7 | nbproject/build-impl.xml.script.CRC32=0238bfbd 8 | nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.92.0.48 9 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | TAMS-KP 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/TAMS/Mysqlconnect.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package TAMS; 7 | import java.sql.*; 8 | import javax.swing.*; 9 | 10 | /** 11 | * 12 | * @author HP 13 | */ 14 | public class Mysqlconnect { 15 | 16 | Connection conn=null; 17 | public static Connection ConnectDB(){ 18 | try{ 19 | Class.forName("com.mysql.jdbc.Driver"); 20 | 21 | Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/testdb", "root", "11606"); 22 | //JOptionPane.showMessageDialog(null,"connected to databasa"); 23 | return conn; 24 | 25 | } 26 | catch (Exception e){ 27 | JOptionPane.showMessageDialog(null,e); 28 | return null; 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /README.html: -------------------------------------------------------------------------------- 1 | # **Travel Agency Management System** :blue_car: :oncoming_bus: 2 | 3 | **Travel Agency Management System** is solution to travel agencies to maintain the details of vehicle, employee, trip and the people booking a trip, in an easier and convenient way. 4 | 5 | 6 | ## **Necessity of the project** 7 | 8 | - Nearly everyone goes on a vacation :airplane:, for this ***Travel agency management system*** would play a vital role in planning a perfect trip :100:. 9 | 10 | - The main purpose is to ***help tourism companies to manage its customers and trips***. 11 | 12 | 13 | ## **Applications & Advantages** 14 | 15 | - Provides an ***user interface for the administrator**** for managing the data present in the travel agency. 16 | 17 | - ***Reduces the time***:clock3: of recording the data. 18 | 19 | ## **Techstacks Used** 20 | 21 | - Netbeans 22 | - MySQL 23 | - Java 24 | 25 | 26 | ## **Contributors** 27 | 28 |
  • Kavya
  • 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/C:/Users/HP/Desktop/TAMS-DBMS/src/TAMS/Book_Trip.java 7 | file:/C:/Users/HP/Desktop/TAMS-DBMS/src/TAMS/Vechicle.java 8 | file:/C:/Users/HP/Desktop/TAMS-DBMS/src/TAMS/Home.java 9 | file:/C:/Users/HP/Desktop/TAMS-DBMS/src/TAMS/Employee.java 10 | file:/C:/Users/HP/Desktop/TAMS-DBMS/src/TAMS/Confirm_book.java 11 | file:/C:/Users/HP/Desktop/TAMS-DBMS/src/TAMS/Login.java 12 | file:/C:/Users/HP/Desktop/TAMS-DBMS/src/TAMS/Mysqlconnect.java 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/TAMS/vechicleDisp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package TAMS; 7 | 8 | /** 9 | * 10 | * @author HP 11 | */ 12 | public class vechicleDisp { 13 | private int Vid; 14 | private String Vname; 15 | private String Regno; 16 | private String Type; 17 | private int cap; 18 | 19 | public vechicleDisp(int Vid, String Vname, String Regno,String Type, int cap) 20 | { 21 | this.Vid = Vid; 22 | this.Vname = Vname; 23 | this.Regno = Regno; 24 | this.Type = Type; 25 | this.cap = cap; 26 | } 27 | 28 | public int getVid() 29 | { 30 | return Vid; 31 | } 32 | 33 | public String getVname() 34 | { 35 | return Vname; 36 | } 37 | 38 | public String getRegno() 39 | { 40 | return Regno; 41 | } 42 | 43 | public String getType() 44 | { 45 | return Type; 46 | } 47 | 48 | public int getCap(){ 49 | return cap; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/TAMS/NewJFrame.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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **Travel Agency Management System** :blue_car: :oncoming_bus: 2 | 3 | **Travel Agency Management System** is solution to travel agencies to maintain the details of vehicle, employee, trip and the people booking a trip, in an easier and convenient way. 4 | 5 | 6 | ## **Necessity of the project** 7 | 8 | - Nearly everyone goes on a vacation :airplane:, for this ***Travel agency management system*** would play a vital role in planning a perfect trip :100:. 9 | 10 | - The main purpose is to ***help tourism companies to manage its customers and trips***. 11 | 12 | 13 | ## **Applications & Advantages** 14 | 15 | - Provides an ***user interface for the administrator*** for managing the data present in the travel agency. 16 | 17 | - ***Reduces the time***:clock3: of recording the data. 18 | 19 | ## **Techstacks Used** 20 | 21 | - Netbeans 22 | - MySQL 23 | - Java 24 | 25 | ## **Demo** 26 | 27 | Click here to watch:point_down: 28 | 29 |
    Travel Agency Management System 30 | 31 | ## **ER-Diagram** 32 | 33 | ![ER-Diagram](https://github.com/praveenhonavar/Travel-Agency-Management-System/blob/master/TAMS-images/Screenshot%20(131).png) 34 | 35 | ## **Schema Diagram** 36 | 37 | ![Schema_diagram](https://github.com/praveenhonavar/Travel-Agency-Management-System/blob/master/TAMS-images/Screenshot%20(132).png) 38 | 39 | 40 | ## **Report** 41 | 42 | [Travel Agency Management System Report](https://drive.google.com/file/d/1mtmDH7QAuskuzH7aIIcGP5pBsvSzA8Nu/view?usp=sharing) 43 | 44 | ## **Screenshots** 45 | 46 | Admin Login page :point_down: 47 | 48 | ![admin login](https://github.com/praveenhonavar/Travel_Agency_Management_System/blob/master/TAMS-images/Screenshot%20(21).png) 49 | 50 | Vehicle Dashboard Page :point_down: 51 | 52 | ![vehicle dashboard](https://github.com/praveenhonavar/Travel_Agency_Management_System/blob/master/TAMS-images/Screenshot%20(22).png) 53 | 54 | Employee Dashboard Page :point_down: 55 | 56 | ![employee dashboard](https://github.com/praveenhonavar/Travel_Agency_Management_System/blob/master/TAMS-images/Screenshot%20(23).png) 57 | 58 | 59 | Booking Dashboard Page :point_down: 60 | 61 | ![booking dashboard](https://github.com/praveenhonavar/Travel_Agency_Management_System/blob/master/TAMS-images/Screenshot%20(24).png) 62 | 63 | 64 | Confirm Booking Page :point_down: 65 | 66 | ![confirm book dashboard](https://github.com/praveenhonavar/Travel_Agency_Management_System/blob/master/TAMS-images/Screenshot%20(25).png) 67 | 68 | 69 | ## **Contributors** 70 | 71 | ***Kavya Pai*** 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/TAMS/NewJFrame.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package TAMS; 7 | 8 | /** 9 | * 10 | * @author HP 11 | */ 12 | public class NewJFrame extends javax.swing.JFrame { 13 | 14 | /** 15 | * Creates new form NewJFrame 16 | */ 17 | public NewJFrame() { 18 | initComponents(); 19 | } 20 | 21 | /** 22 | * This method is called from within the constructor to initialize the form. 23 | * WARNING: Do NOT modify this code. The content of this method is always 24 | * regenerated by the Form Editor. 25 | */ 26 | @SuppressWarnings("unchecked") 27 | // //GEN-BEGIN:initComponents 28 | private void initComponents() { 29 | 30 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 31 | 32 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 33 | getContentPane().setLayout(layout); 34 | layout.setHorizontalGroup( 35 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 36 | .addGap(0, 400, Short.MAX_VALUE) 37 | ); 38 | layout.setVerticalGroup( 39 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 40 | .addGap(0, 300, Short.MAX_VALUE) 41 | ); 42 | 43 | pack(); 44 | }// //GEN-END:initComponents 45 | 46 | /** 47 | * @param args the command line arguments 48 | */ 49 | public static void main(String args[]) { 50 | /* Set the Nimbus look and feel */ 51 | // 52 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 53 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 54 | */ 55 | try { 56 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 57 | if ("Nimbus".equals(info.getName())) { 58 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 59 | break; 60 | } 61 | } 62 | } catch (ClassNotFoundException ex) { 63 | java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 64 | } catch (InstantiationException ex) { 65 | java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 66 | } catch (IllegalAccessException ex) { 67 | java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 68 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 69 | java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 70 | } 71 | // 72 | 73 | /* Create and display the form */ 74 | java.awt.EventQueue.invokeLater(new Runnable() { 75 | public void run() { 76 | new NewJFrame().setVisible(true); 77 | } 78 | }); 79 | } 80 | 81 | // Variables declaration - do not modify//GEN-BEGIN:variables 82 | // End of variables declaration//GEN-END:variables 83 | } 84 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=TAMS-KP 7 | application.vendor=HP 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.modulepath=\ 23 | ${run.modulepath} 24 | debug.test.classpath=\ 25 | ${run.test.classpath} 26 | debug.test.modulepath=\ 27 | ${run.test.modulepath} 28 | # Files in build.classes.dir which should be excluded from distribution jar 29 | dist.archive.excludes= 30 | # This directory is removed when the project is cleaned: 31 | dist.dir=dist 32 | dist.jar=${dist.dir}/TAMS-KP.jar 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | dist.jlink.dir=${dist.dir}/jlink 35 | dist.jlink.output=${dist.jlink.dir}/TAMS-KP 36 | endorsed.classpath= 37 | excludes= 38 | file.reference.jcalendar-1.4.jar=../../../Downloads/jcalendar-1.4/lib/jcalendar-1.4.jar 39 | file.reference.jcalendar-1.4.jar-1=../../Downloads/jcalendar-1.4/lib/jcalendar-1.4.jar 40 | file.reference.jdatepicker-1.3.4.jar=..\\..\\..\\Desktop\\jdatepicker-1.3.4.jar 41 | file.reference.jdatepicker-1.3.4.jar-1=..\\jdatepicker-1.3.4.jar 42 | file.reference.mysql-connector-java-8.0.17.jar=..\\..\\..\\Desktop\\mysql-connector-java-8.0.17\\mysql-connector-java-8.0.17.jar 43 | file.reference.mysql-connector-java-8.0.17.jar-1=C:\\mysql-connector-java-8.0.17\\mysql-connector-java-8.0.17.jar 44 | file.reference.mysql-connector-java-8.0.17.jar-2=..\\mysql-connector-java-8.0.17\\mysql-connector-java-8.0.17.jar 45 | file.reference.rs2xml.jar=..\\..\\..\\Downloads\\rs2xml\\rs2xml.jar 46 | file.reference.rs2xml.jar-1=C:\\rs2xml\\rs2xml.jar 47 | file.reference.rs2xml.jar-2=..\\..\\Downloads\\rs2xml\\rs2xml.jar 48 | file.reference.swingx-all-1.6.4.jar=C:\\Program Files\\NetBeans 8.2\\ide\\modules\\ext\\swingx-all-1.6.4.jar 49 | file.reference.swingx-all-1.6.4.jar-1=C:\\Program Files\\NetBeans-11.1\\netbeans\\ide\\modules\\ext\\swingx-all-1.6.4.jar 50 | includes=** 51 | jar.compress=false 52 | javac.classpath=\ 53 | ${file.reference.mysql-connector-java-8.0.17.jar}:\ 54 | ${file.reference.jdatepicker-1.3.4.jar}:\ 55 | ${file.reference.jcalendar-1.4.jar}:\ 56 | ${file.reference.rs2xml.jar}:\ 57 | ${file.reference.rs2xml.jar-1}:\ 58 | ${file.reference.mysql-connector-java-8.0.17.jar-1}:\ 59 | ${file.reference.swingx-all-1.6.4.jar}:\ 60 | ${file.reference.rs2xml.jar-2}:\ 61 | ${file.reference.jdatepicker-1.3.4.jar-1}:\ 62 | ${file.reference.mysql-connector-java-8.0.17.jar-2}:\ 63 | ${file.reference.swingx-all-1.6.4.jar-1}:\ 64 | ${libs.absolutelayout.classpath}:\ 65 | ${file.reference.jcalendar-1.4.jar-1} 66 | # Space-separated list of extra javac options 67 | javac.compilerargs= 68 | javac.deprecation=false 69 | javac.external.vm=true 70 | javac.modulepath= 71 | javac.processormodulepath= 72 | javac.processorpath=\ 73 | ${javac.classpath} 74 | javac.source=13 75 | javac.target=13 76 | javac.test.classpath=\ 77 | ${javac.classpath}:\ 78 | ${build.classes.dir} 79 | javac.test.modulepath=\ 80 | ${javac.modulepath} 81 | javac.test.processorpath=\ 82 | ${javac.test.classpath} 83 | javadoc.additionalparam= 84 | javadoc.author=false 85 | javadoc.encoding=${source.encoding} 86 | javadoc.html5=false 87 | javadoc.noindex=false 88 | javadoc.nonavbar=false 89 | javadoc.notree=false 90 | javadoc.private=false 91 | javadoc.splitindex=true 92 | javadoc.use=true 93 | javadoc.version=false 94 | javadoc.windowtitle= 95 | # The jlink additional root modules to resolve 96 | jlink.additionalmodules= 97 | # The jlink additional command line parameters 98 | jlink.additionalparam= 99 | jlink.launcher=true 100 | jlink.launcher.name=TAMS-KP 101 | main.class=TAMS.Login 102 | manifest.file=manifest.mf 103 | meta.inf.dir=${src.dir}/META-INF 104 | mkdist.disabled=false 105 | platform.active=default_platform 106 | run.classpath=\ 107 | ${javac.classpath}:\ 108 | ${build.classes.dir} 109 | # Space-separated list of JVM arguments used when running the project. 110 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 111 | # To set system properties for unit tests define test-sys-prop.name=value: 112 | run.jvmargs= 113 | run.modulepath=\ 114 | ${javac.modulepath} 115 | run.test.classpath=\ 116 | ${javac.test.classpath}:\ 117 | ${build.test.classes.dir} 118 | run.test.modulepath=\ 119 | ${javac.test.modulepath} 120 | source.encoding=UTF-8 121 | src.dir=src 122 | test.src.dir=test 123 | -------------------------------------------------------------------------------- /TAMS.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64) 2 | -- 3 | -- Host: 127.0.0.1 Database: testdb 4 | -- ------------------------------------------------------ 5 | -- Server version 8.0.17 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!50503 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `booked_for` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `booked_for`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!50503 SET character_set_client = utf8mb4 */; 25 | CREATE TABLE `booked_for` ( 26 | `VID` int(11) NOT NULL, 27 | `CID` int(11) NOT NULL, 28 | `TID` int(11) NOT NULL, 29 | `BDATE` date DEFAULT NULL, 30 | PRIMARY KEY (`VID`,`CID`,`TID`), 31 | KEY `cfk_tid1_idx` (`TID`), 32 | KEY `cfk_cid1_idx` (`CID`), 33 | CONSTRAINT `cfk_cid1` FOREIGN KEY (`CID`) REFERENCES `customer` (`cid`) ON DELETE CASCADE ON UPDATE RESTRICT, 34 | CONSTRAINT `cfk_tid1` FOREIGN KEY (`TID`) REFERENCES `trip` (`tid`) ON DELETE CASCADE ON UPDATE RESTRICT, 35 | CONSTRAINT `cfk_vid1` FOREIGN KEY (`VID`) REFERENCES `vechicle` (`vid`) ON DELETE CASCADE ON UPDATE RESTRICT 36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 37 | /*!40101 SET character_set_client = @saved_cs_client */; 38 | 39 | -- 40 | -- Table structure for table `customer` 41 | -- 42 | 43 | DROP TABLE IF EXISTS `customer`; 44 | /*!40101 SET @saved_cs_client = @@character_set_client */; 45 | /*!50503 SET character_set_client = utf8mb4 */; 46 | CREATE TABLE `customer` ( 47 | `cid` int(11) NOT NULL, 48 | `cname` varchar(45) DEFAULT NULL, 49 | `caddress` varchar(45) DEFAULT NULL, 50 | `cphone` varchar(20) DEFAULT NULL, 51 | PRIMARY KEY (`cid`) 52 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 53 | /*!40101 SET character_set_client = @saved_cs_client */; 54 | 55 | -- 56 | -- Table structure for table `driven_by` 57 | -- 58 | 59 | DROP TABLE IF EXISTS `driven_by`; 60 | /*!40101 SET @saved_cs_client = @@character_set_client */; 61 | /*!50503 SET character_set_client = utf8mb4 */; 62 | CREATE TABLE `driven_by` ( 63 | `VID` int(11) NOT NULL, 64 | `EID` int(11) NOT NULL, 65 | `TID` int(11) NOT NULL, 66 | `DDATE` date DEFAULT NULL, 67 | PRIMARY KEY (`VID`,`EID`,`TID`), 68 | KEY `cfk_eid1_idx` (`EID`), 69 | KEY `cfk_tid2_idx` (`TID`), 70 | CONSTRAINT `cfk_eid1` FOREIGN KEY (`EID`) REFERENCES `employee` (`eid`) ON DELETE CASCADE ON UPDATE CASCADE, 71 | CONSTRAINT `cfk_tid2` FOREIGN KEY (`TID`) REFERENCES `trip` (`tid`) ON DELETE CASCADE ON UPDATE CASCADE, 72 | CONSTRAINT `cfk_vid2` FOREIGN KEY (`VID`) REFERENCES `vechicle` (`vid`) ON DELETE CASCADE ON UPDATE CASCADE 73 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 74 | /*!40101 SET character_set_client = @saved_cs_client */; 75 | 76 | -- 77 | -- Table structure for table `employee` 78 | -- 79 | 80 | DROP TABLE IF EXISTS `employee`; 81 | /*!40101 SET @saved_cs_client = @@character_set_client */; 82 | /*!50503 SET character_set_client = utf8mb4 */; 83 | CREATE TABLE `employee` ( 84 | `eid` int(11) NOT NULL AUTO_INCREMENT, 85 | `ename` varchar(45) NOT NULL, 86 | `ephone` varchar(20) NOT NULL, 87 | `eaddress` varchar(45) DEFAULT NULL, 88 | `eJdate` date NOT NULL, 89 | PRIMARY KEY (`eid`), 90 | UNIQUE KEY `eid_UNIQUE` (`eid`), 91 | CONSTRAINT `du_che_con` CHECK (((`ejdate` >= _utf8mb4'1990-01-01') and (`ejdate` <= _utf8mb4'2019-12-25'))) 92 | ) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=COMPACT; 93 | /*!40101 SET character_set_client = @saved_cs_client */; 94 | 95 | -- 96 | -- Table structure for table `login` 97 | -- 98 | 99 | DROP TABLE IF EXISTS `login`; 100 | /*!40101 SET @saved_cs_client = @@character_set_client */; 101 | /*!50503 SET character_set_client = utf8mb4 */; 102 | CREATE TABLE `login` ( 103 | `username` varchar(45) NOT NULL, 104 | `password` varchar(45) NOT NULL, 105 | PRIMARY KEY (`password`,`username`) 106 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 107 | /*!40101 SET character_set_client = @saved_cs_client */; 108 | 109 | -- 110 | -- Table structure for table `payment` 111 | -- 112 | 113 | DROP TABLE IF EXISTS `payment`; 114 | /*!40101 SET @saved_cs_client = @@character_set_client */; 115 | /*!50503 SET character_set_client = utf8mb4 */; 116 | CREATE TABLE `payment` ( 117 | `TID` int(11) NOT NULL, 118 | `CID` int(11) NOT NULL, 119 | `DISTANCETRAVEL` varchar(45) DEFAULT NULL, 120 | `AMOUNT` varchar(45) DEFAULT NULL, 121 | `PDATE` date DEFAULT NULL, 122 | PRIMARY KEY (`TID`,`CID`), 123 | KEY `cfk_cid_idx` (`CID`), 124 | CONSTRAINT `cfk_cid` FOREIGN KEY (`CID`) REFERENCES `customer` (`cid`) ON DELETE CASCADE ON UPDATE CASCADE, 125 | CONSTRAINT `cfk_tid` FOREIGN KEY (`TID`) REFERENCES `trip` (`tid`) ON DELETE CASCADE ON UPDATE CASCADE 126 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 127 | 128 | /*!40101 SET character_set_client = @saved_cs_client */; 129 | 130 | -- 131 | -- Table structure for table `places` 132 | -- 133 | 134 | DROP TABLE IF EXISTS `places`; 135 | /*!40101 SET @saved_cs_client = @@character_set_client */; 136 | /*!50503 SET character_set_client = utf8mb4 */; 137 | CREATE TABLE `places` ( 138 | `idplaces` int(11) NOT NULL, 139 | `city` varchar(45) NOT NULL, 140 | `distance` varchar(45) NOT NULL 141 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 142 | /*!40101 SET character_set_client = @saved_cs_client */; 143 | 144 | -- 145 | -- Table structure for table `trip` 146 | -- 147 | 148 | DROP TABLE IF EXISTS `trip`; 149 | /*!40101 SET @saved_cs_client = @@character_set_client */; 150 | /*!50503 SET character_set_client = utf8mb4 */; 151 | CREATE TABLE `trip` ( 152 | `tid` int(11) NOT NULL, 153 | `source` varchar(45) DEFAULT NULL, 154 | `dest` varchar(45) DEFAULT NULL, 155 | `sdate` date DEFAULT NULL, 156 | `edate` date DEFAULT NULL, 157 | PRIMARY KEY (`tid`), 158 | CONSTRAINT `dateconstraint` CHECK (((`sdate` >= sysdate()) and (`sdate` <= _utf8mb4'2025-12-30'))), 159 | CONSTRAINT `dateconstraintsdb` CHECK (((`edate` >= `sdate`) and (`edate` <= _utf8mb4'2025-12-30'))) 160 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 161 | /*!40101 SET character_set_client = @saved_cs_client */; 162 | 163 | -- 164 | -- Table structure for table `vechicle` 165 | -- 166 | 167 | DROP TABLE IF EXISTS `vechicle`; 168 | /*!40101 SET @saved_cs_client = @@character_set_client */; 169 | /*!50503 SET character_set_client = utf8mb4 */; 170 | CREATE TABLE `vechicle` ( 171 | `vid` int(11) NOT NULL AUTO_INCREMENT, 172 | `vname` varchar(50) DEFAULT NULL, 173 | `capacity` int(11) DEFAULT NULL, 174 | `vtype` varchar(50) DEFAULT NULL, 175 | `regno` varchar(50) DEFAULT NULL, 176 | PRIMARY KEY (`vid`), 177 | CONSTRAINT `cap` CHECK ((`capacity` < 60)) 178 | ) ENGINE=InnoDB AUTO_INCREMENT=4473 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 179 | /*!40101 SET character_set_client = @saved_cs_client */; 180 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 181 | 182 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 183 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 184 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 185 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 186 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 187 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 188 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 189 | 190 | -- Dump completed on 2020-11-09 20:49:01 191 | -------------------------------------------------------------------------------- /src/TAMS/Login.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 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /src/TAMS/Login.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package TAMS; 7 | 8 | import java.sql.Connection; 9 | import java.sql.PreparedStatement; 10 | import java.sql.ResultSet; 11 | import javax.swing.JOptionPane; 12 | 13 | /** 14 | * 15 | * @author HP 16 | */ 17 | public class Login extends javax.swing.JFrame { 18 | 19 | /** 20 | * Creates new form Login 21 | */ 22 | public Login() { 23 | initComponents(); 24 | } 25 | 26 | Connection conn=null; 27 | PreparedStatement pst=null; 28 | ResultSet rs=null; 29 | 30 | /** 31 | * This method is called from within the constructor to initialize the form. 32 | * WARNING: Do NOT modify this code. The content of this method is always 33 | * regenerated by the Form Editor. 34 | */ 35 | @SuppressWarnings("unchecked") 36 | // //GEN-BEGIN:initComponents 37 | private void initComponents() { 38 | 39 | jPanel1 = new javax.swing.JPanel(); 40 | user = new javax.swing.JLabel(); 41 | username = new javax.swing.JTextField(); 42 | jLabel2 = new javax.swing.JLabel(); 43 | Login = new javax.swing.JButton(); 44 | header = new javax.swing.JPanel(); 45 | jLabel11 = new javax.swing.JLabel(); 46 | password = new javax.swing.JTextField(); 47 | 48 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 49 | setBackground(new java.awt.Color(0, 0, 51)); 50 | 51 | jPanel1.setBackground(new java.awt.Color(0, 0, 51)); 52 | jPanel1.setForeground(new java.awt.Color(0, 0, 51)); 53 | 54 | user.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 55 | user.setForeground(new java.awt.Color(255, 255, 255)); 56 | user.setText("USERNAME"); 57 | 58 | username.addActionListener(new java.awt.event.ActionListener() { 59 | public void actionPerformed(java.awt.event.ActionEvent evt) { 60 | usernameActionPerformed(evt); 61 | } 62 | }); 63 | 64 | jLabel2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 65 | jLabel2.setForeground(new java.awt.Color(255, 255, 255)); 66 | jLabel2.setText("PASSWORD"); 67 | 68 | Login.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N 69 | Login.setText("LOGIN"); 70 | Login.addActionListener(new java.awt.event.ActionListener() { 71 | public void actionPerformed(java.awt.event.ActionEvent evt) { 72 | LoginActionPerformed(evt); 73 | } 74 | }); 75 | 76 | header.setBackground(new java.awt.Color(102, 0, 153)); 77 | header.addMouseListener(new java.awt.event.MouseAdapter() { 78 | public void mouseClicked(java.awt.event.MouseEvent evt) { 79 | headerMouseClicked(evt); 80 | } 81 | }); 82 | 83 | jLabel11.setFont(new java.awt.Font("Segoe UI", 1, 22)); // NOI18N 84 | jLabel11.setForeground(new java.awt.Color(255, 255, 255)); 85 | jLabel11.setText("LOGIN"); 86 | 87 | javax.swing.GroupLayout headerLayout = new javax.swing.GroupLayout(header); 88 | header.setLayout(headerLayout); 89 | headerLayout.setHorizontalGroup( 90 | headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 91 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headerLayout.createSequentialGroup() 92 | .addContainerGap(261, Short.MAX_VALUE) 93 | .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE) 94 | .addGap(104, 104, 104)) 95 | ); 96 | headerLayout.setVerticalGroup( 97 | headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 98 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headerLayout.createSequentialGroup() 99 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 100 | .addComponent(jLabel11) 101 | .addContainerGap()) 102 | ); 103 | 104 | password.addActionListener(new java.awt.event.ActionListener() { 105 | public void actionPerformed(java.awt.event.ActionEvent evt) { 106 | passwordActionPerformed(evt); 107 | } 108 | }); 109 | 110 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 111 | jPanel1.setLayout(jPanel1Layout); 112 | jPanel1Layout.setHorizontalGroup( 113 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 114 | .addGroup(jPanel1Layout.createSequentialGroup() 115 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 116 | .addGroup(jPanel1Layout.createSequentialGroup() 117 | .addGap(139, 139, 139) 118 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 119 | .addComponent(user) 120 | .addComponent(jLabel2)) 121 | .addGap(65, 65, 65) 122 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 123 | .addComponent(username) 124 | .addComponent(password, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE))) 125 | .addGroup(jPanel1Layout.createSequentialGroup() 126 | .addGap(267, 267, 267) 127 | .addComponent(Login))) 128 | .addContainerGap(89, Short.MAX_VALUE)) 129 | .addComponent(header, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 130 | ); 131 | jPanel1Layout.setVerticalGroup( 132 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 133 | .addGroup(jPanel1Layout.createSequentialGroup() 134 | .addComponent(header, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 135 | .addGap(86, 86, 86) 136 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 137 | .addComponent(username, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 138 | .addComponent(user)) 139 | .addGap(48, 48, 48) 140 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 141 | .addComponent(jLabel2) 142 | .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 143 | .addGap(68, 68, 68) 144 | .addComponent(Login) 145 | .addContainerGap(97, Short.MAX_VALUE)) 146 | ); 147 | 148 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 149 | getContentPane().setLayout(layout); 150 | layout.setHorizontalGroup( 151 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 152 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 153 | ); 154 | layout.setVerticalGroup( 155 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 156 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 157 | ); 158 | 159 | pack(); 160 | }// //GEN-END:initComponents 161 | 162 | private void LoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LoginActionPerformed 163 | // TODO add your handling code here: 164 | 165 | 166 | conn = Mysqlconnect.ConnectDB(); 167 | 168 | String String = "Select * from login where username=? and password=?"; 169 | try{ 170 | pst=conn.prepareStatement(String); 171 | pst.setString(1,username.getText()); 172 | pst.setString(2,password.getText()); 173 | rs=pst.executeQuery(); 174 | 175 | if(rs.next()){ 176 | JOptionPane.showMessageDialog(null,"Login Succesfull"); 177 | Home Hobj= new Home(); 178 | Hobj.setVisible(true); 179 | dispose(); 180 | } 181 | 182 | else{ 183 | JOptionPane.showMessageDialog(null, "invalid username and password","access denied",JOptionPane.ERROR_MESSAGE); 184 | } 185 | 186 | 187 | } 188 | catch (Exception e){ 189 | JOptionPane.showMessageDialog(null, e); 190 | } 191 | 192 | 193 | }//GEN-LAST:event_LoginActionPerformed 194 | 195 | private void headerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_headerMouseClicked 196 | // TODO add your handling code here: 197 | dispose(); 198 | Home Hobj = new Home(); 199 | Hobj.setVisible(true); 200 | }//GEN-LAST:event_headerMouseClicked 201 | 202 | private void usernameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_usernameActionPerformed 203 | // TODO add your handling code here: 204 | }//GEN-LAST:event_usernameActionPerformed 205 | 206 | private void passwordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_passwordActionPerformed 207 | // TODO add your handling code here: 208 | }//GEN-LAST:event_passwordActionPerformed 209 | 210 | /** 211 | * @param args the command line arguments 212 | */ 213 | public static void main(String args[]) { 214 | /* Set the Nimbus look and feel */ 215 | // 216 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 217 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 218 | */ 219 | try { 220 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 221 | if ("Nimbus".equals(info.getName())) { 222 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 223 | break; 224 | } 225 | } 226 | } catch (ClassNotFoundException ex) { 227 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 228 | } catch (InstantiationException ex) { 229 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 230 | } catch (IllegalAccessException ex) { 231 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 232 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 233 | java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 234 | } 235 | // 236 | 237 | /* Create and display the form */ 238 | java.awt.EventQueue.invokeLater(new Runnable() { 239 | public void run() { 240 | new Login().setVisible(true); 241 | } 242 | }); 243 | } 244 | 245 | // Variables declaration - do not modify//GEN-BEGIN:variables 246 | private javax.swing.JButton Login; 247 | private javax.swing.JPanel header; 248 | private javax.swing.JLabel jLabel11; 249 | private javax.swing.JLabel jLabel2; 250 | private javax.swing.JPanel jPanel1; 251 | private javax.swing.JTextField password; 252 | private javax.swing.JLabel user; 253 | private javax.swing.JTextField username; 254 | // End of variables declaration//GEN-END:variables 255 | } 256 | -------------------------------------------------------------------------------- /src/TAMS/Home.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 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | -------------------------------------------------------------------------------- /src/TAMS/Home.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package TAMS; 7 | 8 | import java.awt.Color; 9 | import java.awt.Toolkit; 10 | import java.awt.event.WindowEvent; 11 | import java.sql.Connection; 12 | import java.sql.PreparedStatement; 13 | import java.sql.ResultSet; 14 | import javax.swing.JOptionPane; 15 | import javax.swing.JPanel; 16 | import net.proteanit.sql.DbUtils; 17 | 18 | /** 19 | * 20 | * @author HP 21 | */ 22 | public class Home extends javax.swing.JFrame { 23 | 24 | /** 25 | * Creates new form Home 26 | */ 27 | public Home() { 28 | initComponents(); 29 | } 30 | 31 | Connection conn=null; 32 | PreparedStatement pst=null; 33 | ResultSet rs=null; 34 | 35 | public void close(){ 36 | 37 | WindowEvent winClosingEvent = new WindowEvent(this,WindowEvent.WINDOW_CLOSING); 38 | Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(winClosingEvent); 39 | 40 | } 41 | 42 | /** 43 | * This method is called from within the constructor to initialize the form. 44 | * WARNING: Do NOT modify this code. The content of this method is always 45 | * regenerated by the Form Editor. 46 | */ 47 | @SuppressWarnings("unchecked") 48 | // //GEN-BEGIN:initComponents 49 | private void initComponents() { 50 | 51 | bg = new javax.swing.JPanel(); 52 | sidePanel = new javax.swing.JPanel(); 53 | jPanel2 = new javax.swing.JPanel(); 54 | Home = new javax.swing.JLabel(); 55 | jPanel3 = new javax.swing.JPanel(); 56 | Vechicle = new javax.swing.JLabel(); 57 | jPanel4 = new javax.swing.JPanel(); 58 | Employee = new javax.swing.JLabel(); 59 | jPanel5 = new javax.swing.JPanel(); 60 | Booktrip = new javax.swing.JLabel(); 61 | jLabel1 = new javax.swing.JLabel(); 62 | 63 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 64 | 65 | bg.setPreferredSize(new java.awt.Dimension(6265, 535)); 66 | 67 | sidePanel.setBackground(new java.awt.Color(0, 0, 51)); 68 | sidePanel.setForeground(new java.awt.Color(255, 255, 255)); 69 | 70 | jPanel2.setBackground(new java.awt.Color(0, 0, 51)); 71 | jPanel2.addMouseListener(new java.awt.event.MouseAdapter() { 72 | public void mouseClicked(java.awt.event.MouseEvent evt) { 73 | jPanel2MouseClicked(evt); 74 | } 75 | }); 76 | 77 | Home.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N 78 | Home.setForeground(new java.awt.Color(255, 255, 255)); 79 | Home.setText("Home"); 80 | Home.addMouseListener(new java.awt.event.MouseAdapter() { 81 | public void mouseEntered(java.awt.event.MouseEvent evt) { 82 | HomeMouseEntered(evt); 83 | } 84 | public void mouseExited(java.awt.event.MouseEvent evt) { 85 | HomeMouseExited(evt); 86 | } 87 | }); 88 | 89 | javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); 90 | jPanel2.setLayout(jPanel2Layout); 91 | jPanel2Layout.setHorizontalGroup( 92 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 93 | .addGroup(jPanel2Layout.createSequentialGroup() 94 | .addGap(45, 45, 45) 95 | .addComponent(Home, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) 96 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 97 | ); 98 | jPanel2Layout.setVerticalGroup( 99 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 100 | .addGroup(jPanel2Layout.createSequentialGroup() 101 | .addContainerGap() 102 | .addComponent(Home, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) 103 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 104 | ); 105 | 106 | jPanel3.setBackground(new java.awt.Color(0, 0, 51)); 107 | 108 | Vechicle.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N 109 | Vechicle.setForeground(new java.awt.Color(255, 255, 255)); 110 | Vechicle.setText("Vechicle"); 111 | Vechicle.addMouseListener(new java.awt.event.MouseAdapter() { 112 | public void mouseClicked(java.awt.event.MouseEvent evt) { 113 | VechicleMouseClicked(evt); 114 | } 115 | public void mouseEntered(java.awt.event.MouseEvent evt) { 116 | VechicleMouseEntered(evt); 117 | } 118 | public void mouseExited(java.awt.event.MouseEvent evt) { 119 | VechicleMouseExited(evt); 120 | } 121 | }); 122 | 123 | javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); 124 | jPanel3.setLayout(jPanel3Layout); 125 | jPanel3Layout.setHorizontalGroup( 126 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 127 | .addGroup(jPanel3Layout.createSequentialGroup() 128 | .addGap(41, 41, 41) 129 | .addComponent(Vechicle, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) 130 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 131 | ); 132 | jPanel3Layout.setVerticalGroup( 133 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 134 | .addGroup(jPanel3Layout.createSequentialGroup() 135 | .addComponent(Vechicle, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) 136 | .addGap(0, 10, Short.MAX_VALUE)) 137 | ); 138 | 139 | jPanel4.setBackground(new java.awt.Color(0, 0, 51)); 140 | 141 | Employee.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N 142 | Employee.setForeground(new java.awt.Color(255, 255, 255)); 143 | Employee.setText("Employee"); 144 | Employee.addMouseListener(new java.awt.event.MouseAdapter() { 145 | public void mouseClicked(java.awt.event.MouseEvent evt) { 146 | EmployeeMouseClicked(evt); 147 | } 148 | public void mouseEntered(java.awt.event.MouseEvent evt) { 149 | EmployeeMouseEntered(evt); 150 | } 151 | public void mouseExited(java.awt.event.MouseEvent evt) { 152 | EmployeeMouseExited(evt); 153 | } 154 | }); 155 | 156 | javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); 157 | jPanel4.setLayout(jPanel4Layout); 158 | jPanel4Layout.setHorizontalGroup( 159 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 160 | .addGroup(jPanel4Layout.createSequentialGroup() 161 | .addGap(31, 31, 31) 162 | .addComponent(Employee, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) 163 | .addContainerGap(123, Short.MAX_VALUE)) 164 | ); 165 | jPanel4Layout.setVerticalGroup( 166 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 167 | .addGroup(jPanel4Layout.createSequentialGroup() 168 | .addComponent(Employee, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) 169 | .addGap(0, 14, Short.MAX_VALUE)) 170 | ); 171 | 172 | jPanel5.setBackground(new java.awt.Color(0, 0, 51)); 173 | jPanel5.addMouseListener(new java.awt.event.MouseAdapter() { 174 | public void mouseEntered(java.awt.event.MouseEvent evt) { 175 | jPanel5MouseEntered(evt); 176 | } 177 | public void mouseExited(java.awt.event.MouseEvent evt) { 178 | jPanel5MouseExited(evt); 179 | } 180 | }); 181 | 182 | Booktrip.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N 183 | Booktrip.setForeground(new java.awt.Color(255, 255, 255)); 184 | Booktrip.setText("Book Trip"); 185 | Booktrip.addMouseListener(new java.awt.event.MouseAdapter() { 186 | public void mouseClicked(java.awt.event.MouseEvent evt) { 187 | BooktripMouseClicked(evt); 188 | } 189 | public void mouseEntered(java.awt.event.MouseEvent evt) { 190 | BooktripMouseEntered(evt); 191 | } 192 | public void mouseExited(java.awt.event.MouseEvent evt) { 193 | BooktripMouseExited(evt); 194 | } 195 | }); 196 | 197 | javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); 198 | jPanel5.setLayout(jPanel5Layout); 199 | jPanel5Layout.setHorizontalGroup( 200 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 201 | .addGroup(jPanel5Layout.createSequentialGroup() 202 | .addGap(32, 32, 32) 203 | .addComponent(Booktrip, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) 204 | .addContainerGap(115, Short.MAX_VALUE)) 205 | ); 206 | jPanel5Layout.setVerticalGroup( 207 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 208 | .addGroup(jPanel5Layout.createSequentialGroup() 209 | .addContainerGap() 210 | .addComponent(Booktrip, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) 211 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 212 | ); 213 | 214 | javax.swing.GroupLayout sidePanelLayout = new javax.swing.GroupLayout(sidePanel); 215 | sidePanel.setLayout(sidePanelLayout); 216 | sidePanelLayout.setHorizontalGroup( 217 | sidePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 218 | .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 219 | .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 220 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sidePanelLayout.createSequentialGroup() 221 | .addContainerGap() 222 | .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 223 | .addContainerGap()) 224 | .addGroup(sidePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 225 | .addGroup(sidePanelLayout.createSequentialGroup() 226 | .addContainerGap() 227 | .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 228 | .addContainerGap())) 229 | ); 230 | sidePanelLayout.setVerticalGroup( 231 | sidePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 232 | .addGroup(sidePanelLayout.createSequentialGroup() 233 | .addGap(102, 102, 102) 234 | .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 235 | .addGap(120, 120, 120) 236 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 237 | .addGap(38, 38, 38) 238 | .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 239 | .addContainerGap(3808, Short.MAX_VALUE)) 240 | .addGroup(sidePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 241 | .addGroup(sidePanelLayout.createSequentialGroup() 242 | .addGap(182, 182, 182) 243 | .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 244 | .addContainerGap(3974, Short.MAX_VALUE))) 245 | ); 246 | 247 | jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N 248 | jLabel1.setText("Travel Agency Management System"); 249 | 250 | javax.swing.GroupLayout bgLayout = new javax.swing.GroupLayout(bg); 251 | bg.setLayout(bgLayout); 252 | bgLayout.setHorizontalGroup( 253 | bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 254 | .addGroup(bgLayout.createSequentialGroup() 255 | .addComponent(sidePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 256 | .addGap(163, 163, 163) 257 | .addComponent(jLabel1) 258 | .addContainerGap(3008, Short.MAX_VALUE)) 259 | ); 260 | bgLayout.setVerticalGroup( 261 | bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 262 | .addGroup(bgLayout.createSequentialGroup() 263 | .addGroup(bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 264 | .addComponent(sidePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 265 | .addGroup(bgLayout.createSequentialGroup() 266 | .addGap(225, 225, 225) 267 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))) 268 | .addContainerGap()) 269 | ); 270 | 271 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 272 | getContentPane().setLayout(layout); 273 | layout.setHorizontalGroup( 274 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 275 | .addGroup(layout.createSequentialGroup() 276 | .addComponent(bg, javax.swing.GroupLayout.PREFERRED_SIZE, 4088, javax.swing.GroupLayout.PREFERRED_SIZE) 277 | .addGap(0, 842, Short.MAX_VALUE)) 278 | ); 279 | layout.setVerticalGroup( 280 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 281 | .addGroup(layout.createSequentialGroup() 282 | .addComponent(bg, javax.swing.GroupLayout.PREFERRED_SIZE, 3652, javax.swing.GroupLayout.PREFERRED_SIZE) 283 | .addGap(0, 429, Short.MAX_VALUE)) 284 | ); 285 | 286 | pack(); 287 | }// //GEN-END:initComponents 288 | 289 | private void BooktripMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BooktripMouseClicked 290 | // TODO add your handling code here: 291 | dispose(); // TO CLOSE PREVIOUS WINDOWS 292 | Book_Trip Btobj = new Book_Trip(); 293 | Btobj.setVisible(true); 294 | }//GEN-LAST:event_BooktripMouseClicked 295 | 296 | private void VechicleMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_VechicleMouseClicked 297 | // TODO add your handling code here: 298 | 299 | Vechicle Vobj = new Vechicle(); 300 | Vobj.setVisible(true); 301 | dispose(); 302 | // 303 | }//GEN-LAST:event_VechicleMouseClicked 304 | 305 | private void EmployeeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EmployeeMouseClicked 306 | // TODO add your handling code here: 307 | dispose(); 308 | Employee Eobj = new Employee(); 309 | Eobj.setVisible(true); 310 | 311 | }//GEN-LAST:event_EmployeeMouseClicked 312 | 313 | public void setColor(JPanel p){ 314 | p.setBackground(new Color(102,0,153)); 315 | } 316 | 317 | public void resetColor(JPanel p){ 318 | p.setBackground(new Color(0,0,51)); 319 | } 320 | 321 | private void jPanel5MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel5MouseEntered 322 | // TODO add your handling code here: 323 | setColor(jPanel5); 324 | }//GEN-LAST:event_jPanel5MouseEntered 325 | 326 | private void jPanel5MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel5MouseExited 327 | // TODO add your handling code here: 328 | resetColor(jPanel5); 329 | }//GEN-LAST:event_jPanel5MouseExited 330 | 331 | private void BooktripMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BooktripMouseEntered 332 | // TODO add your handling code here: 333 | setColor(jPanel5); 334 | }//GEN-LAST:event_BooktripMouseEntered 335 | 336 | private void BooktripMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BooktripMouseExited 337 | // TODO add your handling code here: 338 | resetColor(jPanel5); 339 | }//GEN-LAST:event_BooktripMouseExited 340 | 341 | private void HomeMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_HomeMouseEntered 342 | // TODO add your handling code here: 343 | setColor(jPanel2); 344 | }//GEN-LAST:event_HomeMouseEntered 345 | 346 | private void HomeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_HomeMouseExited 347 | // TODO add your handling code here: 348 | resetColor(jPanel2); 349 | }//GEN-LAST:event_HomeMouseExited 350 | 351 | private void VechicleMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_VechicleMouseEntered 352 | // TODO add your handling code here: 353 | setColor(jPanel3); 354 | }//GEN-LAST:event_VechicleMouseEntered 355 | 356 | private void VechicleMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_VechicleMouseExited 357 | // TODO add your handling code here: 358 | resetColor(jPanel3); 359 | }//GEN-LAST:event_VechicleMouseExited 360 | 361 | private void EmployeeMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EmployeeMouseEntered 362 | // TODO add your handling code here: 363 | setColor(jPanel4); 364 | 365 | }//GEN-LAST:event_EmployeeMouseEntered 366 | 367 | private void EmployeeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EmployeeMouseExited 368 | // TODO add your handling code here: 369 | resetColor(jPanel4); 370 | }//GEN-LAST:event_EmployeeMouseExited 371 | 372 | private void jPanel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel2MouseClicked 373 | // TODO add your handling code here: 374 | Login Lobj = new Login(); 375 | Lobj.setVisible(true); 376 | dispose(); 377 | }//GEN-LAST:event_jPanel2MouseClicked 378 | 379 | /** 380 | * @param args the command line arguments 381 | */ 382 | public static void main(String args[]) { 383 | /* Set the Nimbus look and feel */ 384 | // 385 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 386 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 387 | */ 388 | try { 389 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 390 | if ("Nimbus".equals(info.getName())) { 391 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 392 | break; 393 | } 394 | } 395 | } catch (ClassNotFoundException ex) { 396 | java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 397 | } catch (InstantiationException ex) { 398 | java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 399 | } catch (IllegalAccessException ex) { 400 | java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 401 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 402 | java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 403 | } 404 | // 405 | 406 | /* Create and display the form */ 407 | java.awt.EventQueue.invokeLater(new Runnable() { 408 | public void run() { 409 | new Home().setVisible(true); 410 | } 411 | }); 412 | } 413 | 414 | // Variables declaration - do not modify//GEN-BEGIN:variables 415 | private javax.swing.JLabel Booktrip; 416 | private javax.swing.JLabel Employee; 417 | private javax.swing.JLabel Home; 418 | private javax.swing.JLabel Vechicle; 419 | private javax.swing.JPanel bg; 420 | private javax.swing.JLabel jLabel1; 421 | private javax.swing.JPanel jPanel2; 422 | private javax.swing.JPanel jPanel3; 423 | private javax.swing.JPanel jPanel4; 424 | private javax.swing.JPanel jPanel5; 425 | private javax.swing.JPanel sidePanel; 426 | // End of variables declaration//GEN-END:variables 427 | } 428 | -------------------------------------------------------------------------------- /src/TAMS/Employee.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 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 |
    333 |
    334 | 335 | 336 | 337 | 338 | <Editor/> 339 | <Renderer/> 340 | </Column> 341 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 342 | <Title/> 343 | <Editor/> 344 | <Renderer/> 345 | </Column> 346 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 347 | <Title/> 348 | <Editor/> 349 | <Renderer/> 350 | </Column> 351 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 352 | <Title/> 353 | <Editor/> 354 | <Renderer/> 355 | </Column> 356 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 357 | <Title/> 358 | <Editor/> 359 | <Renderer/> 360 | </Column> 361 | </TableColumnModel> 362 | </Property> 363 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 364 | <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 365 | </Property> 366 | </Properties> 367 | <Events> 368 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="EtableMouseClicked"/> 369 | </Events> 370 | </Component> 371 | </SubComponents> 372 | </Container> 373 | <Component class="org.jdesktop.swingx.JXDatePicker" name="Ejdate"> 374 | </Component> 375 | </SubComponents> 376 | </Container> 377 | </SubComponents> 378 | </Form> 379 | -------------------------------------------------------------------------------- /src/TAMS/Employee.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package TAMS; 7 | 8 | import java.sql.Connection; 9 | import java.sql.Time; 10 | import java.sql.PreparedStatement; 11 | import java.sql.ResultSet; 12 | import java.text.ParseException; 13 | import java.text.SimpleDateFormat; 14 | import java.util.Date; 15 | import java.util.logging.Level; 16 | import java.util.logging.Logger; 17 | import javax.swing.JOptionPane; 18 | import javax.swing.table.DefaultTableModel; 19 | import net.proteanit.sql.DbUtils; 20 | 21 | /** 22 | * 23 | * @author HP 24 | */ 25 | public class Employee extends javax.swing.JFrame { 26 | 27 | Connection conn=null; 28 | PreparedStatement pst=null; 29 | ResultSet rs=null; 30 | 31 | 32 | /** 33 | * Creates new form Employee 34 | */ 35 | 36 | public Employee() { 37 | initComponents(); 38 | conn = Mysqlconnect.ConnectDB(); 39 | fetch(); 40 | } 41 | 42 | public void fetch(){ 43 | try{ 44 | String sql="select * from employee"; 45 | pst=conn.prepareStatement(sql); 46 | rs=pst.executeQuery(); 47 | Etable.setModel(DbUtils.resultSetToTableModel(rs)); 48 | } 49 | 50 | catch(Exception e){ 51 | JOptionPane.showMessageDialog(null,e); 52 | 53 | } 54 | } 55 | 56 | /** 57 | * This method is called from within the constructor to initialize the form. 58 | * WARNING: Do NOT modify this code. The content of this method is always 59 | * regenerated by the Form Editor. 60 | */ 61 | @SuppressWarnings("unchecked") 62 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 63 | private void initComponents() { 64 | 65 | Epane = new javax.swing.JPanel(); 66 | header = new javax.swing.JPanel(); 67 | jLabel6 = new javax.swing.JLabel(); 68 | jLabel1 = new javax.swing.JLabel(); 69 | jLabel2 = new javax.swing.JLabel(); 70 | jLabel3 = new javax.swing.JLabel(); 71 | jLabel4 = new javax.swing.JLabel(); 72 | jLabel5 = new javax.swing.JLabel(); 73 | Ename = new javax.swing.JTextField(); 74 | Ephone = new javax.swing.JTextField(); 75 | Eaddress = new javax.swing.JTextField(); 76 | Eid = new javax.swing.JTextField(); 77 | Addbtn = new javax.swing.JButton(); 78 | Modbtn = new javax.swing.JButton(); 79 | Delbtn = new javax.swing.JButton(); 80 | Clrbtn = new javax.swing.JButton(); 81 | Espane = new javax.swing.JScrollPane(); 82 | Etable = new javax.swing.JTable(); 83 | Ejdate = new org.jdesktop.swingx.JXDatePicker(); 84 | 85 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 86 | 87 | Epane.setBackground(new java.awt.Color(0, 0, 51)); 88 | 89 | header.setBackground(new java.awt.Color(102, 0, 153)); 90 | header.addMouseListener(new java.awt.event.MouseAdapter() { 91 | public void mouseClicked(java.awt.event.MouseEvent evt) { 92 | headerMouseClicked(evt); 93 | } 94 | }); 95 | 96 | jLabel6.setFont(new java.awt.Font("Segoe UI", 1, 22)); // NOI18N 97 | jLabel6.setForeground(new java.awt.Color(255, 255, 255)); 98 | jLabel6.setText("EMPLOYEE DASHBOARD"); 99 | 100 | javax.swing.GroupLayout headerLayout = new javax.swing.GroupLayout(header); 101 | header.setLayout(headerLayout); 102 | headerLayout.setHorizontalGroup( 103 | headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 104 | .addGroup(headerLayout.createSequentialGroup() 105 | .addGap(295, 295, 295) 106 | .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE) 107 | .addContainerGap(232, Short.MAX_VALUE)) 108 | ); 109 | headerLayout.setVerticalGroup( 110 | headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 111 | .addGroup(headerLayout.createSequentialGroup() 112 | .addContainerGap() 113 | .addComponent(jLabel6) 114 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 115 | ); 116 | 117 | jLabel1.setBackground(new java.awt.Color(255, 255, 255)); 118 | jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 119 | jLabel1.setForeground(new java.awt.Color(255, 255, 255)); 120 | jLabel1.setText("Employee Name "); 121 | 122 | jLabel2.setBackground(new java.awt.Color(255, 255, 255)); 123 | jLabel2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 124 | jLabel2.setForeground(new java.awt.Color(255, 255, 255)); 125 | jLabel2.setText("Employee ID "); 126 | 127 | jLabel3.setBackground(new java.awt.Color(255, 255, 255)); 128 | jLabel3.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 129 | jLabel3.setForeground(new java.awt.Color(255, 255, 255)); 130 | jLabel3.setText("Address"); 131 | 132 | jLabel4.setBackground(new java.awt.Color(255, 255, 255)); 133 | jLabel4.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 134 | jLabel4.setForeground(new java.awt.Color(255, 255, 255)); 135 | jLabel4.setText("Joining Date"); 136 | 137 | jLabel5.setBackground(new java.awt.Color(255, 255, 255)); 138 | jLabel5.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 139 | jLabel5.setForeground(new java.awt.Color(255, 255, 255)); 140 | jLabel5.setText("Phone Number"); 141 | 142 | Ename.addActionListener(new java.awt.event.ActionListener() { 143 | public void actionPerformed(java.awt.event.ActionEvent evt) { 144 | EnameActionPerformed(evt); 145 | } 146 | }); 147 | 148 | Ephone.addActionListener(new java.awt.event.ActionListener() { 149 | public void actionPerformed(java.awt.event.ActionEvent evt) { 150 | EphoneActionPerformed(evt); 151 | } 152 | }); 153 | 154 | Eaddress.addActionListener(new java.awt.event.ActionListener() { 155 | public void actionPerformed(java.awt.event.ActionEvent evt) { 156 | EaddressActionPerformed(evt); 157 | } 158 | }); 159 | 160 | Eid.addActionListener(new java.awt.event.ActionListener() { 161 | public void actionPerformed(java.awt.event.ActionEvent evt) { 162 | EidActionPerformed(evt); 163 | } 164 | }); 165 | 166 | Addbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 167 | Addbtn.setText("ADD"); 168 | Addbtn.addActionListener(new java.awt.event.ActionListener() { 169 | public void actionPerformed(java.awt.event.ActionEvent evt) { 170 | AddbtnActionPerformed(evt); 171 | } 172 | }); 173 | 174 | Modbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 175 | Modbtn.setText("MODIFY"); 176 | Modbtn.addActionListener(new java.awt.event.ActionListener() { 177 | public void actionPerformed(java.awt.event.ActionEvent evt) { 178 | ModbtnActionPerformed(evt); 179 | } 180 | }); 181 | 182 | Delbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 183 | Delbtn.setText("DELETE"); 184 | Delbtn.addActionListener(new java.awt.event.ActionListener() { 185 | public void actionPerformed(java.awt.event.ActionEvent evt) { 186 | DelbtnActionPerformed(evt); 187 | } 188 | }); 189 | 190 | Clrbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 191 | Clrbtn.setText("CLEAR"); 192 | Clrbtn.addActionListener(new java.awt.event.ActionListener() { 193 | public void actionPerformed(java.awt.event.ActionEvent evt) { 194 | ClrbtnActionPerformed(evt); 195 | } 196 | }); 197 | 198 | Etable.setModel(new javax.swing.table.DefaultTableModel( 199 | new Object [][] { 200 | 201 | }, 202 | new String [] { 203 | "Employee ID", "Employee name ", "Phone", "Address", "Join Date" 204 | } 205 | )); 206 | Etable.addMouseListener(new java.awt.event.MouseAdapter() { 207 | public void mouseClicked(java.awt.event.MouseEvent evt) { 208 | EtableMouseClicked(evt); 209 | } 210 | }); 211 | Espane.setViewportView(Etable); 212 | 213 | javax.swing.GroupLayout EpaneLayout = new javax.swing.GroupLayout(Epane); 214 | Epane.setLayout(EpaneLayout); 215 | EpaneLayout.setHorizontalGroup( 216 | EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 217 | .addComponent(header, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 218 | .addGroup(EpaneLayout.createSequentialGroup() 219 | .addGap(29, 29, 29) 220 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 221 | .addComponent(jLabel1) 222 | .addComponent(jLabel5) 223 | .addComponent(jLabel3) 224 | .addComponent(jLabel4) 225 | .addComponent(jLabel2)) 226 | .addGap(73, 73, 73) 227 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 228 | .addComponent(Ephone, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE) 229 | .addComponent(Ename) 230 | .addComponent(Eaddress) 231 | .addComponent(Eid) 232 | .addComponent(Ejdate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 233 | .addGap(87, 87, 87) 234 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 235 | .addComponent(Clrbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) 236 | .addComponent(Delbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) 237 | .addComponent(Modbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) 238 | .addComponent(Addbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)) 239 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 240 | .addGroup(EpaneLayout.createSequentialGroup() 241 | .addContainerGap() 242 | .addComponent(Espane) 243 | .addContainerGap()) 244 | ); 245 | EpaneLayout.setVerticalGroup( 246 | EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 247 | .addGroup(EpaneLayout.createSequentialGroup() 248 | .addComponent(header, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 249 | .addGap(50, 50, 50) 250 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 251 | .addComponent(jLabel2) 252 | .addComponent(Eid, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) 253 | .addGap(2, 2, 2) 254 | .addComponent(Addbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) 255 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 256 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 257 | .addGroup(EpaneLayout.createSequentialGroup() 258 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 259 | .addComponent(Ename, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) 260 | .addComponent(jLabel1)) 261 | .addGap(41, 41, 41)) 262 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, EpaneLayout.createSequentialGroup() 263 | .addComponent(Modbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) 264 | .addGap(10, 10, 10))) 265 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 266 | .addGroup(EpaneLayout.createSequentialGroup() 267 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 268 | .addComponent(jLabel5) 269 | .addComponent(Ephone, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) 270 | .addGap(36, 36, 36) 271 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 272 | .addComponent(Eaddress, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) 273 | .addComponent(jLabel3)) 274 | .addGap(40, 40, 40) 275 | .addGroup(EpaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 276 | .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 277 | .addComponent(Ejdate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 278 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 279 | .addGroup(EpaneLayout.createSequentialGroup() 280 | .addGap(17, 17, 17) 281 | .addComponent(Clrbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) 282 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE) 283 | .addComponent(Delbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) 284 | .addGap(86, 86, 86))) 285 | .addComponent(Espane, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) 286 | .addContainerGap()) 287 | ); 288 | 289 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 290 | getContentPane().setLayout(layout); 291 | layout.setHorizontalGroup( 292 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 293 | .addGroup(layout.createSequentialGroup() 294 | .addComponent(Epane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 295 | .addGap(0, 10, Short.MAX_VALUE)) 296 | ); 297 | layout.setVerticalGroup( 298 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 299 | .addComponent(Epane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 300 | ); 301 | 302 | pack(); 303 | }// </editor-fold>//GEN-END:initComponents 304 | 305 | private void EnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EnameActionPerformed 306 | // TODO add your handling code here: 307 | }//GEN-LAST:event_EnameActionPerformed 308 | 309 | private void EphoneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EphoneActionPerformed 310 | // TODO add your handling code here: 311 | }//GEN-LAST:event_EphoneActionPerformed 312 | 313 | private void EaddressActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EaddressActionPerformed 314 | // TODO add your handling code here: 315 | }//GEN-LAST:event_EaddressActionPerformed 316 | 317 | private void EidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EidActionPerformed 318 | // TODO add your handling code here: 319 | }//GEN-LAST:event_EidActionPerformed 320 | 321 | private void AddbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddbtnActionPerformed 322 | // TODO add your handling code here: 323 | conn = Mysqlconnect.ConnectDB(); 324 | 325 | String query = "INSERT INTO EMPLOYEE (ENAME,EPHONE,EADDRESS,EJDATE)VALUES(?,?,?,?)"; 326 | 327 | try{ 328 | 329 | pst =conn.prepareStatement(query); 330 | //pst.setString(1,Eid.getText()); 331 | pst.setString(1,Ename.getText()); 332 | pst.setString(2,Ephone.getText()); 333 | pst.setString(3,Eaddress.getText()); 334 | pst.setDate(4, new java.sql.Date(Ejdate.getDate().getTime())); 335 | 336 | pst.execute(); 337 | 338 | JOptionPane.showMessageDialog(null,"Employee added"); 339 | 340 | fetch(); 341 | 342 | try{ 343 | 344 | } 345 | catch(Exception e){ 346 | JOptionPane.showMessageDialog(null,e); 347 | } 348 | } 349 | catch(Exception e){ 350 | JOptionPane.showMessageDialog(null,e); 351 | } 352 | 353 | }//GEN-LAST:event_AddbtnActionPerformed 354 | 355 | private void ModbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModbtnActionPerformed 356 | // TODO add your handling code here: 357 | conn = Mysqlconnect.ConnectDB(); 358 | 359 | int row = Etable.getSelectedRow(); 360 | //System.out.println(row); 361 | 362 | String cell = Etable.getModel().getValueAt(row,0).toString(); 363 | 364 | System.out.println(cell); 365 | 366 | String modsql = "UPDATE EMPLOYEE SET ENAME =?,EPHONE =?,EADDRESS=?,EJDATE=? WHERE EID ="+cell; 367 | 368 | try{ 369 | pst=conn.prepareStatement(modsql); 370 | 371 | pst.setString(1,Ename.getText()); 372 | pst.setString(2,Ephone.getText()); 373 | pst.setString(3,Eaddress.getText()); 374 | pst.setDate(4, new java.sql.Date(Ejdate.getDate().getTime())); 375 | 376 | pst.execute(); 377 | 378 | JOptionPane.showMessageDialog(null,"Table Modified"); 379 | 380 | fetch(); 381 | } 382 | 383 | catch(Exception e){ 384 | JOptionPane.showMessageDialog(null,e); 385 | } 386 | }//GEN-LAST:event_ModbtnActionPerformed 387 | 388 | private void DelbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DelbtnActionPerformed 389 | // TODO add your handling code here: 390 | conn = Mysqlconnect.ConnectDB(); 391 | 392 | int row = Etable.getSelectedRow(); 393 | //System.out.println(row); 394 | String cell = Etable.getModel().getValueAt(row,0).toString(); 395 | System.out.println(cell); 396 | 397 | String delsql = "DELETE FROM EMPLOYEE WHERE EID = "+ cell; 398 | 399 | try{ 400 | pst=conn.prepareStatement(delsql); 401 | pst.execute(); 402 | JOptionPane.showMessageDialog(null,"Employee Deleted"); 403 | fetch(); 404 | } 405 | catch(Exception e){ 406 | 407 | } 408 | }//GEN-LAST:event_DelbtnActionPerformed 409 | 410 | private void ClrbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ClrbtnActionPerformed 411 | // TODO add your handling code here: 412 | Eid.setText(" "); 413 | Ename.setText(" "); 414 | Ephone.setText(" "); 415 | Eaddress.setText(" "); 416 | Ejdate.setDate(null); 417 | }//GEN-LAST:event_ClrbtnActionPerformed 418 | 419 | private void headerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_headerMouseClicked 420 | // TODO add your handling code here: 421 | dispose(); 422 | Home Hobj = new Home(); 423 | Hobj.setVisible(true); 424 | }//GEN-LAST:event_headerMouseClicked 425 | 426 | private void EtableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EtableMouseClicked 427 | // TODO add your handling code here: 428 | // TODO add your handling code here: 429 | // TO LOAD DATA INTO TEXT FIELD 430 | DefaultTableModel model = (DefaultTableModel)Etable.getModel(); 431 | 432 | // get the selected row index 433 | int selectedRowIndex = Etable.getSelectedRow(); 434 | 435 | // set the selected row data into jtextfields 436 | Eid.setText(model.getValueAt(selectedRowIndex, 0).toString()); 437 | Ename.setText(model.getValueAt(selectedRowIndex, 1).toString()); 438 | Ephone.setText(model.getValueAt(selectedRowIndex, 2).toString()); 439 | Eaddress.setText(model.getValueAt(selectedRowIndex, 3).toString()); 440 | java.util.Date date1; 441 | 442 | 443 | try { 444 | date1 = new SimpleDateFormat("yyyy-MM-dd").parse(model.getValueAt(selectedRowIndex,4).toString()); 445 | Ejdate.setDate(date1); 446 | 447 | } catch (ParseException ex) { 448 | Logger.getLogger(Book_Trip.class.getName()).log(Level.SEVERE, null, ex); 449 | } 450 | 451 | // try { 452 | // Date date = (Date) new SimpleDateFormat("yyyy-MM-dd").parse((String)model.getValueAt(selectedRowIndex, 4)); 453 | // //System.out.println(date.toString()); 454 | // Ejdate.setDate(model.getValueAt(selectedRowIndex,date); 455 | // } 456 | // catch (ParseException ex) { 457 | // Logger.getLogger(Employee.class.getName()).log(Level.SEVERE, null, ex); 458 | // } 459 | }//GEN-LAST:event_EtableMouseClicked 460 | 461 | /** 462 | * @param args the command line arguments 463 | */ 464 | public static void main(String args[]) { 465 | /* Set the Nimbus look and feel */ 466 | //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> 467 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 468 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 469 | */ 470 | 471 | try { 472 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 473 | if ("Nimbus".equals(info.getName())) { 474 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 475 | break; 476 | } 477 | } 478 | } catch (ClassNotFoundException ex) { 479 | java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 480 | } catch (InstantiationException ex) { 481 | java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 482 | } catch (IllegalAccessException ex) { 483 | java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 484 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 485 | java.util.logging.Logger.getLogger(Employee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 486 | } 487 | //</editor-fold> 488 | 489 | /* Create and display the form */ 490 | java.awt.EventQueue.invokeLater(new Runnable() { 491 | public void run() { 492 | new Employee().setVisible(true); 493 | 494 | } 495 | }); 496 | } 497 | 498 | // Variables declaration - do not modify//GEN-BEGIN:variables 499 | private javax.swing.JButton Addbtn; 500 | private javax.swing.JButton Clrbtn; 501 | private javax.swing.JButton Delbtn; 502 | private javax.swing.JTextField Eaddress; 503 | private javax.swing.JTextField Eid; 504 | private org.jdesktop.swingx.JXDatePicker Ejdate; 505 | private javax.swing.JTextField Ename; 506 | private javax.swing.JPanel Epane; 507 | private javax.swing.JTextField Ephone; 508 | private javax.swing.JScrollPane Espane; 509 | private javax.swing.JTable Etable; 510 | private javax.swing.JButton Modbtn; 511 | private javax.swing.JPanel header; 512 | private javax.swing.JLabel jLabel1; 513 | private javax.swing.JLabel jLabel2; 514 | private javax.swing.JLabel jLabel3; 515 | private javax.swing.JLabel jLabel4; 516 | private javax.swing.JLabel jLabel5; 517 | private javax.swing.JLabel jLabel6; 518 | // End of variables declaration//GEN-END:variables 519 | } 520 | -------------------------------------------------------------------------------- /src/TAMS/Vechicle.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 | <Component class="javax.swing.JLabel" name="jLabel7"> 6 | <Properties> 7 | <Property name="text" type="java.lang.String" value="jLabel7"/> 8 | </Properties> 9 | </Component> 10 | </NonVisualComponents> 11 | <Properties> 12 | <Property name="defaultCloseOperation" type="int" value="3"/> 13 | </Properties> 14 | <SyntheticProperties> 15 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 16 | <SyntheticProperty name="generateCenter" type="boolean" value="false"/> 17 | </SyntheticProperties> 18 | <Events> 19 | <EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseEntered"/> 20 | </Events> 21 | <AuxValues> 22 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 23 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 24 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 25 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 26 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 27 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 28 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 29 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 30 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 31 | </AuxValues> 32 | 33 | <Layout> 34 | <DimensionLayout dim="0"> 35 | <Group type="103" groupAlignment="0" attributes="0"> 36 | <Group type="102" alignment="0" attributes="0"> 37 | <Component id="bg" min="-2" pref="869" max="-2" attributes="0"/> 38 | <EmptySpace min="0" pref="1" max="32767" attributes="0"/> 39 | </Group> 40 | </Group> 41 | </DimensionLayout> 42 | <DimensionLayout dim="1"> 43 | <Group type="103" groupAlignment="0" attributes="0"> 44 | <Group type="102" alignment="0" attributes="0"> 45 | <Component id="bg" min="-2" max="-2" attributes="0"/> 46 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 47 | </Group> 48 | </Group> 49 | </DimensionLayout> 50 | </Layout> 51 | <SubComponents> 52 | <Container class="javax.swing.JPanel" name="bg"> 53 | 54 | <Layout> 55 | <DimensionLayout dim="0"> 56 | <Group type="103" groupAlignment="0" attributes="0"> 57 | <Group type="102" alignment="1" attributes="0"> 58 | <EmptySpace max="32767" attributes="0"/> 59 | <Group type="103" groupAlignment="1" max="-2" attributes="0"> 60 | <Component id="header" max="32767" attributes="0"/> 61 | <Component id="sidepane" min="-2" pref="856" max="-2" attributes="0"/> 62 | </Group> 63 | <EmptySpace min="-2" pref="332" max="-2" attributes="0"/> 64 | </Group> 65 | </Group> 66 | </DimensionLayout> 67 | <DimensionLayout dim="1"> 68 | <Group type="103" groupAlignment="0" attributes="0"> 69 | <Group type="102" alignment="0" attributes="0"> 70 | <Component id="header" min="-2" max="-2" attributes="0"/> 71 | <EmptySpace max="-2" attributes="0"/> 72 | <Component id="sidepane" max="32767" attributes="0"/> 73 | </Group> 74 | </Group> 75 | </DimensionLayout> 76 | </Layout> 77 | <SubComponents> 78 | <Container class="javax.swing.JPanel" name="header"> 79 | <Properties> 80 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 81 | <Color blue="99" green="0" red="66" type="rgb"/> 82 | </Property> 83 | </Properties> 84 | <Events> 85 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="headerMouseClicked"/> 86 | </Events> 87 | 88 | <Layout> 89 | <DimensionLayout dim="0"> 90 | <Group type="103" groupAlignment="0" attributes="0"> 91 | <Group type="102" alignment="1" attributes="0"> 92 | <EmptySpace min="-2" pref="207" max="-2" attributes="0"/> 93 | <Component id="back" min="-2" max="-2" attributes="0"/> 94 | <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> 95 | <Component id="Back" min="-2" max="-2" attributes="0"/> 96 | <EmptySpace min="-2" pref="73" max="-2" attributes="0"/> 97 | <Component id="jLabel6" min="-2" pref="274" max="-2" attributes="0"/> 98 | <EmptySpace max="32767" attributes="0"/> 99 | </Group> 100 | </Group> 101 | </DimensionLayout> 102 | <DimensionLayout dim="1"> 103 | <Group type="103" groupAlignment="0" attributes="0"> 104 | <Group type="102" attributes="0"> 105 | <EmptySpace max="-2" attributes="0"/> 106 | <Group type="103" groupAlignment="3" attributes="0"> 107 | <Component id="Back" alignment="3" min="-2" max="-2" attributes="0"/> 108 | <Component id="back" alignment="3" min="-2" max="-2" attributes="0"/> 109 | </Group> 110 | <EmptySpace max="32767" attributes="0"/> 111 | </Group> 112 | <Group type="102" alignment="1" attributes="0"> 113 | <EmptySpace max="32767" attributes="0"/> 114 | <Component id="jLabel6" min="-2" max="-2" attributes="0"/> 115 | <EmptySpace max="-2" attributes="0"/> 116 | </Group> 117 | </Group> 118 | </DimensionLayout> 119 | </Layout> 120 | <SubComponents> 121 | <Component class="javax.swing.JLabel" name="jLabel6"> 122 | <Properties> 123 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 124 | <Font name="Segoe UI" size="22" style="1"/> 125 | </Property> 126 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 127 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 128 | </Property> 129 | <Property name="text" type="java.lang.String" value="VECHICLE DASHBOARD"/> 130 | </Properties> 131 | </Component> 132 | <Component class="javax.swing.JLabel" name="Back"> 133 | </Component> 134 | <Component class="javax.swing.JLabel" name="back"> 135 | </Component> 136 | </SubComponents> 137 | </Container> 138 | <Container class="javax.swing.JPanel" name="sidepane"> 139 | <Properties> 140 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 141 | <Color blue="33" green="0" red="0" type="rgb"/> 142 | </Property> 143 | </Properties> 144 | <Events> 145 | <EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="sidepaneMouseEntered"/> 146 | </Events> 147 | 148 | <Layout> 149 | <DimensionLayout dim="0"> 150 | <Group type="103" groupAlignment="0" attributes="0"> 151 | <Group type="102" alignment="0" attributes="0"> 152 | <EmptySpace max="-2" attributes="0"/> 153 | <Group type="103" groupAlignment="0" attributes="0"> 154 | <Group type="102" alignment="0" attributes="0"> 155 | <Component id="scrolvehicletable" min="-2" pref="839" max="-2" attributes="0"/> 156 | <EmptySpace max="32767" attributes="0"/> 157 | </Group> 158 | <Group type="102" alignment="0" attributes="0"> 159 | <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> 160 | <Group type="103" groupAlignment="0" attributes="0"> 161 | <Component id="jLabel5" min="-2" max="-2" attributes="0"/> 162 | <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 163 | <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> 164 | <Component id="jLabel4" min="-2" max="-2" attributes="0"/> 165 | </Group> 166 | <Group type="103" groupAlignment="0" attributes="0"> 167 | <Group type="102" attributes="0"> 168 | <EmptySpace max="32767" attributes="0"/> 169 | <Group type="103" groupAlignment="0" attributes="0"> 170 | <Component id="Vtype" min="-2" pref="275" max="-2" attributes="0"/> 171 | <Component id="cap" min="-2" pref="275" max="-2" attributes="0"/> 172 | <Component id="Vname" alignment="0" min="-2" pref="275" max="-2" attributes="0"/> 173 | </Group> 174 | <EmptySpace min="-2" pref="125" max="-2" attributes="0"/> 175 | <Group type="103" groupAlignment="1" attributes="0"> 176 | <Component id="Modbtn" min="-2" pref="104" max="-2" attributes="0"/> 177 | <Component id="Addbtn" min="-2" pref="104" max="-2" attributes="0"/> 178 | <Component id="Delbtn" alignment="1" min="-2" pref="104" max="-2" attributes="0"/> 179 | </Group> 180 | </Group> 181 | <Group type="102" attributes="0"> 182 | <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> 183 | <Component id="Regno" min="-2" pref="275" max="-2" attributes="0"/> 184 | <EmptySpace max="32767" attributes="0"/> 185 | <Component id="Clrbtn" min="-2" pref="104" max="-2" attributes="0"/> 186 | </Group> 187 | </Group> 188 | <EmptySpace min="-2" pref="103" max="-2" attributes="0"/> 189 | </Group> 190 | </Group> 191 | </Group> 192 | </Group> 193 | </DimensionLayout> 194 | <DimensionLayout dim="1"> 195 | <Group type="103" groupAlignment="0" attributes="0"> 196 | <Group type="102" attributes="0"> 197 | <EmptySpace pref="92" max="32767" attributes="0"/> 198 | <Group type="103" groupAlignment="0" attributes="0"> 199 | <Group type="103" groupAlignment="3" attributes="0"> 200 | <Component id="Vname" alignment="3" min="-2" pref="28" max="-2" attributes="0"/> 201 | <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> 202 | </Group> 203 | <Component id="Addbtn" min="-2" pref="36" max="-2" attributes="0"/> 204 | </Group> 205 | <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> 206 | <Group type="103" groupAlignment="0" attributes="0"> 207 | <Group type="102" alignment="0" attributes="0"> 208 | <Group type="103" groupAlignment="3" attributes="0"> 209 | <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> 210 | <Component id="Vtype" alignment="3" min="-2" pref="28" max="-2" attributes="0"/> 211 | <Component id="Modbtn" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> 212 | </Group> 213 | <Group type="103" groupAlignment="0" attributes="0"> 214 | <Group type="102" attributes="0"> 215 | <EmptySpace min="-2" pref="41" max="-2" attributes="0"/> 216 | <Component id="cap" min="-2" pref="31" max="-2" attributes="0"/> 217 | </Group> 218 | <Group type="102" alignment="0" attributes="0"> 219 | <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> 220 | <Component id="Delbtn" min="-2" pref="36" max="-2" attributes="0"/> 221 | </Group> 222 | </Group> 223 | <EmptySpace type="separate" max="-2" attributes="0"/> 224 | <Component id="Clrbtn" min="-2" pref="36" max="-2" attributes="0"/> 225 | </Group> 226 | <Group type="102" alignment="0" attributes="0"> 227 | <EmptySpace min="-2" pref="77" max="-2" attributes="0"/> 228 | <Component id="jLabel3" min="-2" max="-2" attributes="0"/> 229 | <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> 230 | <Group type="103" groupAlignment="3" attributes="0"> 231 | <Component id="Regno" alignment="3" min="-2" pref="31" max="-2" attributes="0"/> 232 | <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> 233 | </Group> 234 | </Group> 235 | </Group> 236 | <EmptySpace min="-2" pref="81" max="-2" attributes="0"/> 237 | <Component id="scrolvehicletable" min="-2" pref="92" max="-2" attributes="0"/> 238 | <EmptySpace max="-2" attributes="0"/> 239 | </Group> 240 | </Group> 241 | </DimensionLayout> 242 | </Layout> 243 | <SubComponents> 244 | <Component class="javax.swing.JTextField" name="cap"> 245 | <Events> 246 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="capActionPerformed"/> 247 | </Events> 248 | </Component> 249 | <Component class="javax.swing.JLabel" name="jLabel2"> 250 | <Properties> 251 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 252 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 253 | </Property> 254 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 255 | <Font name="Segoe UI" size="18" style="1"/> 256 | </Property> 257 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 258 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 259 | </Property> 260 | <Property name="text" type="java.lang.String" value="Vechicle Name"/> 261 | </Properties> 262 | </Component> 263 | <Component class="javax.swing.JLabel" name="jLabel3"> 264 | <Properties> 265 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 266 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 267 | </Property> 268 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 269 | <Font name="Segoe UI" size="18" style="1"/> 270 | </Property> 271 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 272 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 273 | </Property> 274 | <Property name="text" type="java.lang.String" value="Capacity "/> 275 | </Properties> 276 | </Component> 277 | <Component class="javax.swing.JLabel" name="jLabel4"> 278 | <Properties> 279 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 280 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 281 | </Property> 282 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 283 | <Font name="Segoe UI" size="18" style="1"/> 284 | </Property> 285 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 286 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 287 | </Property> 288 | <Property name="text" type="java.lang.String" value="Register Number"/> 289 | </Properties> 290 | </Component> 291 | <Component class="javax.swing.JLabel" name="jLabel5"> 292 | <Properties> 293 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 294 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 295 | </Property> 296 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 297 | <Font name="Segoe UI" size="18" style="1"/> 298 | </Property> 299 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 300 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 301 | </Property> 302 | <Property name="text" type="java.lang.String" value="Vechicle Type "/> 303 | </Properties> 304 | </Component> 305 | <Component class="javax.swing.JTextField" name="Vname"> 306 | <Events> 307 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="VnameActionPerformed"/> 308 | </Events> 309 | </Component> 310 | <Component class="javax.swing.JTextField" name="Regno"> 311 | <Events> 312 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="RegnoActionPerformed"/> 313 | </Events> 314 | </Component> 315 | <Component class="javax.swing.JTextField" name="Vtype"> 316 | <Events> 317 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="VtypeActionPerformed"/> 318 | </Events> 319 | </Component> 320 | <Component class="javax.swing.JButton" name="Modbtn"> 321 | <Properties> 322 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 323 | <Font name="Segoe UI" size="18" style="1"/> 324 | </Property> 325 | <Property name="text" type="java.lang.String" value="MODIFY"/> 326 | </Properties> 327 | <Events> 328 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ModbtnActionPerformed"/> 329 | </Events> 330 | </Component> 331 | <Component class="javax.swing.JButton" name="Delbtn"> 332 | <Properties> 333 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 334 | <Font name="Segoe UI" size="18" style="1"/> 335 | </Property> 336 | <Property name="text" type="java.lang.String" value="DELETE"/> 337 | </Properties> 338 | <Events> 339 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="DelbtnActionPerformed"/> 340 | </Events> 341 | </Component> 342 | <Component class="javax.swing.JButton" name="Clrbtn"> 343 | <Properties> 344 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 345 | <Font name="Segoe UI" size="18" style="1"/> 346 | </Property> 347 | <Property name="text" type="java.lang.String" value="CLEAR"/> 348 | </Properties> 349 | <Events> 350 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ClrbtnActionPerformed"/> 351 | </Events> 352 | </Component> 353 | <Component class="javax.swing.JButton" name="Addbtn"> 354 | <Properties> 355 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 356 | <Font name="Segoe UI" size="18" style="1"/> 357 | </Property> 358 | <Property name="text" type="java.lang.String" value="ADD"/> 359 | </Properties> 360 | <Events> 361 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="AddbtnActionPerformed"/> 362 | </Events> 363 | </Component> 364 | <Container class="javax.swing.JScrollPane" name="scrolvehicletable"> 365 | <Events> 366 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="scrolvehicletableMouseClicked"/> 367 | </Events> 368 | 369 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 370 | <SubComponents> 371 | <Component class="javax.swing.JTable" name="Vtable"> 372 | <Properties> 373 | <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 374 | <Table columnCount="5" rowCount="0"> 375 | <Column editable="true" title="Vechicle ID" type="java.lang.Object"/> 376 | <Column editable="true" title="Vechicle Name" type="java.lang.Object"/> 377 | <Column editable="true" title="Vechicle Type" type="java.lang.Object"/> 378 | <Column editable="true" title="Capacity" type="java.lang.Object"/> 379 | <Column editable="true" title="Register Number" type="java.lang.Object"/> 380 | </Table> 381 | </Property> 382 | <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 383 | <TableColumnModel selectionModel="0"> 384 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 385 | <Title/> 386 | <Editor/> 387 | <Renderer/> 388 | </Column> 389 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 390 | <Title/> 391 | <Editor/> 392 | <Renderer/> 393 | </Column> 394 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 395 | <Title/> 396 | <Editor/> 397 | <Renderer/> 398 | </Column> 399 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 400 | <Title/> 401 | <Editor/> 402 | <Renderer/> 403 | </Column> 404 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 405 | <Title/> 406 | <Editor/> 407 | <Renderer/> 408 | </Column> 409 | </TableColumnModel> 410 | </Property> 411 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 412 | <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 413 | </Property> 414 | </Properties> 415 | <Events> 416 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="VtableMouseClicked"/> 417 | <EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="VtableKeyTyped"/> 418 | </Events> 419 | </Component> 420 | </SubComponents> 421 | </Container> 422 | </SubComponents> 423 | </Container> 424 | </SubComponents> 425 | </Container> 426 | </SubComponents> 427 | </Form> 428 | -------------------------------------------------------------------------------- /src/TAMS/Vechicle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package TAMS; 7 | 8 | import java.sql.*; 9 | import java.util.ArrayList; 10 | import javax.swing.*; 11 | import java.util.Date; 12 | import java.util.logging.Level; 13 | import java.util.logging.Logger; 14 | import javax.swing.table.DefaultTableModel; 15 | import javax.swing.table.TableModel; 16 | import net.proteanit.sql.DbUtils; 17 | /** 18 | * 19 | * @author HP 20 | */ 21 | public class Vechicle extends javax.swing.JFrame { 22 | Connection conn=null; 23 | PreparedStatement pst=null; 24 | ResultSet rs=null; 25 | 26 | public Vechicle() { 27 | initComponents(); 28 | //setExtendedState(MAXIMIZED_BOTH); 29 | conn = Mysqlconnect.ConnectDB(); 30 | fetch(); 31 | 32 | } 33 | 34 | /** 35 | * Creates new form 36 | */ 37 | public void fetch(){ 38 | try{ 39 | String sql="select * from vehicle"; 40 | pst=conn.prepareStatement(sql); 41 | rs=pst.executeQuery(); 42 | Vtable.setModel(DbUtils.resultSetToTableModel(rs)); 43 | } 44 | 45 | catch(Exception e){ 46 | JOptionPane.showMessageDialog(null,e); 47 | } 48 | } 49 | 50 | 51 | 52 | 53 | /** 54 | * This method is called from within the constructor to initialize the form. 55 | * WARNING: Do NOT modify this code. The content of this method is always 56 | * regenerated by the Form Editor. 57 | */ 58 | @SuppressWarnings("unchecked") 59 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 60 | private void initComponents() { 61 | 62 | jLabel7 = new javax.swing.JLabel(); 63 | bg = new javax.swing.JPanel(); 64 | header = new javax.swing.JPanel(); 65 | jLabel6 = new javax.swing.JLabel(); 66 | Back = new javax.swing.JLabel(); 67 | back = new javax.swing.JLabel(); 68 | sidepane = new javax.swing.JPanel(); 69 | cap = new javax.swing.JTextField(); 70 | jLabel2 = new javax.swing.JLabel(); 71 | jLabel3 = new javax.swing.JLabel(); 72 | jLabel4 = new javax.swing.JLabel(); 73 | jLabel5 = new javax.swing.JLabel(); 74 | Vname = new javax.swing.JTextField(); 75 | Regno = new javax.swing.JTextField(); 76 | Vtype = new javax.swing.JTextField(); 77 | Modbtn = new javax.swing.JButton(); 78 | Delbtn = new javax.swing.JButton(); 79 | Clrbtn = new javax.swing.JButton(); 80 | Addbtn = new javax.swing.JButton(); 81 | scrolvehicletable = new javax.swing.JScrollPane(); 82 | Vtable = new javax.swing.JTable(); 83 | 84 | jLabel7.setText("jLabel7"); 85 | 86 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 87 | addMouseListener(new java.awt.event.MouseAdapter() { 88 | public void mouseEntered(java.awt.event.MouseEvent evt) { 89 | formMouseEntered(evt); 90 | } 91 | }); 92 | 93 | header.setBackground(new java.awt.Color(102, 0, 153)); 94 | header.addMouseListener(new java.awt.event.MouseAdapter() { 95 | public void mouseClicked(java.awt.event.MouseEvent evt) { 96 | headerMouseClicked(evt); 97 | } 98 | }); 99 | 100 | jLabel6.setFont(new java.awt.Font("Segoe UI", 1, 22)); // NOI18N 101 | jLabel6.setForeground(new java.awt.Color(255, 255, 255)); 102 | jLabel6.setText("VECHICLE DASHBOARD"); 103 | 104 | javax.swing.GroupLayout headerLayout = new javax.swing.GroupLayout(header); 105 | header.setLayout(headerLayout); 106 | headerLayout.setHorizontalGroup( 107 | headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 108 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headerLayout.createSequentialGroup() 109 | .addGap(207, 207, 207) 110 | .addComponent(back) 111 | .addGap(18, 18, 18) 112 | .addComponent(Back) 113 | .addGap(73, 73, 73) 114 | .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE) 115 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 116 | ); 117 | headerLayout.setVerticalGroup( 118 | headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 119 | .addGroup(headerLayout.createSequentialGroup() 120 | .addContainerGap() 121 | .addGroup(headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 122 | .addComponent(Back) 123 | .addComponent(back)) 124 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 125 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headerLayout.createSequentialGroup() 126 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 127 | .addComponent(jLabel6) 128 | .addContainerGap()) 129 | ); 130 | 131 | sidepane.setBackground(new java.awt.Color(0, 0, 51)); 132 | sidepane.addMouseListener(new java.awt.event.MouseAdapter() { 133 | public void mouseEntered(java.awt.event.MouseEvent evt) { 134 | sidepaneMouseEntered(evt); 135 | } 136 | }); 137 | 138 | cap.addActionListener(new java.awt.event.ActionListener() { 139 | public void actionPerformed(java.awt.event.ActionEvent evt) { 140 | capActionPerformed(evt); 141 | } 142 | }); 143 | 144 | jLabel2.setBackground(new java.awt.Color(255, 255, 255)); 145 | jLabel2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 146 | jLabel2.setForeground(new java.awt.Color(255, 255, 255)); 147 | jLabel2.setText("Vechicle Name"); 148 | 149 | jLabel3.setBackground(new java.awt.Color(255, 255, 255)); 150 | jLabel3.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 151 | jLabel3.setForeground(new java.awt.Color(255, 255, 255)); 152 | jLabel3.setText("Capacity "); 153 | 154 | jLabel4.setBackground(new java.awt.Color(255, 255, 255)); 155 | jLabel4.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 156 | jLabel4.setForeground(new java.awt.Color(255, 255, 255)); 157 | jLabel4.setText("Register Number"); 158 | 159 | jLabel5.setBackground(new java.awt.Color(255, 255, 255)); 160 | jLabel5.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 161 | jLabel5.setForeground(new java.awt.Color(255, 255, 255)); 162 | jLabel5.setText("Vechicle Type "); 163 | 164 | Vname.addActionListener(new java.awt.event.ActionListener() { 165 | public void actionPerformed(java.awt.event.ActionEvent evt) { 166 | VnameActionPerformed(evt); 167 | } 168 | }); 169 | 170 | Regno.addActionListener(new java.awt.event.ActionListener() { 171 | public void actionPerformed(java.awt.event.ActionEvent evt) { 172 | RegnoActionPerformed(evt); 173 | } 174 | }); 175 | 176 | Vtype.addActionListener(new java.awt.event.ActionListener() { 177 | public void actionPerformed(java.awt.event.ActionEvent evt) { 178 | VtypeActionPerformed(evt); 179 | } 180 | }); 181 | 182 | Modbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 183 | Modbtn.setText("MODIFY"); 184 | Modbtn.addActionListener(new java.awt.event.ActionListener() { 185 | public void actionPerformed(java.awt.event.ActionEvent evt) { 186 | ModbtnActionPerformed(evt); 187 | } 188 | }); 189 | 190 | Delbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 191 | Delbtn.setText("DELETE"); 192 | Delbtn.addActionListener(new java.awt.event.ActionListener() { 193 | public void actionPerformed(java.awt.event.ActionEvent evt) { 194 | DelbtnActionPerformed(evt); 195 | } 196 | }); 197 | 198 | Clrbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 199 | Clrbtn.setText("CLEAR"); 200 | Clrbtn.addActionListener(new java.awt.event.ActionListener() { 201 | public void actionPerformed(java.awt.event.ActionEvent evt) { 202 | ClrbtnActionPerformed(evt); 203 | } 204 | }); 205 | 206 | Addbtn.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N 207 | Addbtn.setText("ADD"); 208 | Addbtn.addActionListener(new java.awt.event.ActionListener() { 209 | public void actionPerformed(java.awt.event.ActionEvent evt) { 210 | AddbtnActionPerformed(evt); 211 | } 212 | }); 213 | 214 | scrolvehicletable.addMouseListener(new java.awt.event.MouseAdapter() { 215 | public void mouseClicked(java.awt.event.MouseEvent evt) { 216 | scrolvehicletableMouseClicked(evt); 217 | } 218 | }); 219 | 220 | Vtable.setModel(new javax.swing.table.DefaultTableModel( 221 | new Object [][] { 222 | 223 | }, 224 | new String [] { 225 | "Vechicle ID", "Vechicle Name", "Vechicle Type", "Capacity", "Register Number" 226 | } 227 | )); 228 | Vtable.addMouseListener(new java.awt.event.MouseAdapter() { 229 | public void mouseClicked(java.awt.event.MouseEvent evt) { 230 | VtableMouseClicked(evt); 231 | } 232 | }); 233 | Vtable.addKeyListener(new java.awt.event.KeyAdapter() { 234 | public void keyTyped(java.awt.event.KeyEvent evt) { 235 | VtableKeyTyped(evt); 236 | } 237 | }); 238 | scrolvehicletable.setViewportView(Vtable); 239 | 240 | javax.swing.GroupLayout sidepaneLayout = new javax.swing.GroupLayout(sidepane); 241 | sidepane.setLayout(sidepaneLayout); 242 | sidepaneLayout.setHorizontalGroup( 243 | sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 244 | .addGroup(sidepaneLayout.createSequentialGroup() 245 | .addContainerGap() 246 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 247 | .addGroup(sidepaneLayout.createSequentialGroup() 248 | .addComponent(scrolvehicletable, javax.swing.GroupLayout.PREFERRED_SIZE, 839, javax.swing.GroupLayout.PREFERRED_SIZE) 249 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 250 | .addGroup(sidepaneLayout.createSequentialGroup() 251 | .addGap(32, 32, 32) 252 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 253 | .addComponent(jLabel5) 254 | .addComponent(jLabel2) 255 | .addComponent(jLabel3) 256 | .addComponent(jLabel4)) 257 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 258 | .addGroup(sidepaneLayout.createSequentialGroup() 259 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 260 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 261 | .addComponent(Vtype, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) 262 | .addComponent(cap, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) 263 | .addComponent(Vname, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)) 264 | .addGap(125, 125, 125) 265 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 266 | .addComponent(Modbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) 267 | .addComponent(Addbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) 268 | .addComponent(Delbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))) 269 | .addGroup(sidepaneLayout.createSequentialGroup() 270 | .addGap(66, 66, 66) 271 | .addComponent(Regno, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) 272 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 273 | .addComponent(Clrbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))) 274 | .addGap(103, 103, 103)))) 275 | ); 276 | sidepaneLayout.setVerticalGroup( 277 | sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 278 | .addGroup(sidepaneLayout.createSequentialGroup() 279 | .addContainerGap(92, Short.MAX_VALUE) 280 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 281 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 282 | .addComponent(Vname, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) 283 | .addComponent(jLabel2)) 284 | .addComponent(Addbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) 285 | .addGap(28, 28, 28) 286 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 287 | .addGroup(sidepaneLayout.createSequentialGroup() 288 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 289 | .addComponent(jLabel5) 290 | .addComponent(Vtype, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) 291 | .addComponent(Modbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) 292 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 293 | .addGroup(sidepaneLayout.createSequentialGroup() 294 | .addGap(41, 41, 41) 295 | .addComponent(cap, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) 296 | .addGroup(sidepaneLayout.createSequentialGroup() 297 | .addGap(26, 26, 26) 298 | .addComponent(Delbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))) 299 | .addGap(18, 18, 18) 300 | .addComponent(Clrbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) 301 | .addGroup(sidepaneLayout.createSequentialGroup() 302 | .addGap(77, 77, 77) 303 | .addComponent(jLabel3) 304 | .addGap(38, 38, 38) 305 | .addGroup(sidepaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 306 | .addComponent(Regno, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 307 | .addComponent(jLabel4)))) 308 | .addGap(81, 81, 81) 309 | .addComponent(scrolvehicletable, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) 310 | .addContainerGap()) 311 | ); 312 | 313 | javax.swing.GroupLayout bgLayout = new javax.swing.GroupLayout(bg); 314 | bg.setLayout(bgLayout); 315 | bgLayout.setHorizontalGroup( 316 | bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 317 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bgLayout.createSequentialGroup() 318 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 319 | .addGroup(bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 320 | .addComponent(header, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 321 | .addComponent(sidepane, javax.swing.GroupLayout.PREFERRED_SIZE, 856, javax.swing.GroupLayout.PREFERRED_SIZE)) 322 | .addGap(332, 332, 332)) 323 | ); 324 | bgLayout.setVerticalGroup( 325 | bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 326 | .addGroup(bgLayout.createSequentialGroup() 327 | .addComponent(header, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 328 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 329 | .addComponent(sidepane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 330 | ); 331 | 332 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 333 | getContentPane().setLayout(layout); 334 | layout.setHorizontalGroup( 335 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 336 | .addGroup(layout.createSequentialGroup() 337 | .addComponent(bg, javax.swing.GroupLayout.PREFERRED_SIZE, 869, javax.swing.GroupLayout.PREFERRED_SIZE) 338 | .addGap(0, 1, Short.MAX_VALUE)) 339 | ); 340 | layout.setVerticalGroup( 341 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 342 | .addGroup(layout.createSequentialGroup() 343 | .addComponent(bg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 344 | .addGap(0, 0, Short.MAX_VALUE)) 345 | ); 346 | 347 | pack(); 348 | }// </editor-fold>//GEN-END:initComponents 349 | 350 | private void capActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_capActionPerformed 351 | // TODO add your handling code here: 352 | }//GEN-LAST:event_capActionPerformed 353 | 354 | private void VnameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VnameActionPerformed 355 | // TODO add your handling code here: 356 | }//GEN-LAST:event_VnameActionPerformed 357 | 358 | private void RegnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RegnoActionPerformed 359 | // TODO add your handling code here: 360 | }//GEN-LAST:event_RegnoActionPerformed 361 | 362 | private void VtypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VtypeActionPerformed 363 | // TODO add your handling code here: 364 | }//GEN-LAST:event_VtypeActionPerformed 365 | 366 | private void ModbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModbtnActionPerformed 367 | // TODO add your handling code here: 368 | conn = Mysqlconnect.ConnectDB(); 369 | 370 | int row = Vtable.getSelectedRow(); 371 | //System.out.println(row); 372 | String cell = Vtable.getModel().getValueAt(row,0).toString(); 373 | System.out.println(cell); 374 | 375 | String modsql = "UPDATE VEHICLE SET VNAME =?,CAPACITY =?,VTYPE=?,REGNO=? WHERE VID ="+cell; 376 | 377 | try{ 378 | pst=conn.prepareStatement(modsql); 379 | 380 | pst.setString(1,Vname.getText()); 381 | pst.setString(2,cap.getText()); 382 | pst.setString(3,Vtype.getText()); 383 | pst.setString(4,Regno.getText()); 384 | 385 | pst.execute(); 386 | JOptionPane.showMessageDialog(null,"Table Modified"); 387 | fetch(); 388 | } 389 | catch(Exception e){ 390 | 391 | JOptionPane.showMessageDialog(null,e); 392 | } 393 | 394 | 395 | 396 | }//GEN-LAST:event_ModbtnActionPerformed 397 | 398 | private void DelbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DelbtnActionPerformed 399 | // TODO add your handling code here: 400 | conn = Mysqlconnect.ConnectDB(); 401 | 402 | int row = Vtable.getSelectedRow(); 403 | //System.out.println(row); 404 | String cell = Vtable.getModel().getValueAt(row,0).toString(); 405 | System.out.println(cell); 406 | 407 | String delsql = "DELETE FROM VEHICLE WHERE VID = "+ cell; 408 | 409 | try{ 410 | pst=conn.prepareStatement(delsql); 411 | pst.execute(); 412 | 413 | fetch(); 414 | } 415 | catch(Exception e){ 416 | 417 | } 418 | }//GEN-LAST:event_DelbtnActionPerformed 419 | 420 | private void ClrbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ClrbtnActionPerformed 421 | // Vid2.setText(" "); 422 | Vname.setText(" "); 423 | cap.setText(" "); 424 | Vtype.setText(" "); 425 | Regno.setText(" "); 426 | 427 | }//GEN-LAST:event_ClrbtnActionPerformed 428 | 429 | private void AddbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddbtnActionPerformed 430 | conn = Mysqlconnect.ConnectDB(); 431 | 432 | // String query = "insert into vehicle (vid, vname, capacity, type, regno)" 433 | // + " values (?, ?, ?, ?, ?)"; 434 | 435 | String query = "insert into vehicle ( vname, capacity, vtype, regno)" 436 | + " values ( ?, ?, ?, ?)"; 437 | 438 | try{ 439 | pst=conn.prepareStatement(query); 440 | 441 | //41111111111111111111111111111111111111111111111111111111111 pst.setString(1,Vid2.getText()); 442 | 443 | pst = conn.prepareStatement(query, Statement.RETURN_GENERATED_KEYS); 444 | pst.setString(1,Vname.getText()); 445 | pst.setString(2,cap.getText()); 446 | pst.setString(3,Vtype.getText()); 447 | pst.setString(4,Regno.getText()); 448 | 449 | pst.execute(); 450 | 451 | 452 | 453 | JOptionPane.showMessageDialog(null,"vechicle added"); 454 | 455 | try{ 456 | String sql="select * from vehicle"; 457 | pst=conn.prepareStatement(sql); 458 | rs=pst.executeQuery(); 459 | Vtable.setModel(DbUtils.resultSetToTableModel(rs)); 460 | } 461 | catch(Exception e){ 462 | JOptionPane.showMessageDialog(null,e); 463 | 464 | } 465 | 466 | 467 | 468 | conn.close(); 469 | } 470 | catch (Exception e){ 471 | JOptionPane.showMessageDialog(null, e); 472 | } 473 | // TODO add your handling code here: 474 | }//GEN-LAST:event_AddbtnActionPerformed 475 | 476 | private void headerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_headerMouseClicked 477 | // TODO add your handling code here: 478 | dispose(); 479 | Home Hobj = new Home(); 480 | Hobj.setVisible(true); 481 | 482 | }//GEN-LAST:event_headerMouseClicked 483 | 484 | private void scrolvehicletableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_scrolvehicletableMouseClicked 485 | 486 | }//GEN-LAST:event_scrolvehicletableMouseClicked 487 | 488 | private void VtableKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_VtableKeyTyped 489 | // TODO add your handling code here: 490 | }//GEN-LAST:event_VtableKeyTyped 491 | 492 | private void VtableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_VtableMouseClicked 493 | // TODO add your handling code here: 494 | // TO LOAD DATA INTO TEXT FIELD 495 | DefaultTableModel model = (DefaultTableModel)Vtable.getModel(); 496 | 497 | // get the selected row index 498 | int selectedRowIndex = Vtable.getSelectedRow(); 499 | 500 | // set the selected row data into jtextfields 501 | //Vid2.setText(model.getValueAt(selectedRowIndex, 0).toString()); 502 | Vname.setText(model.getValueAt(selectedRowIndex, 1).toString()); 503 | cap.setText(model.getValueAt(selectedRowIndex, 2).toString()); 504 | Vtype.setText(model.getValueAt(selectedRowIndex, 3).toString()); 505 | Regno.setText(model.getValueAt(selectedRowIndex, 4).toString()); 506 | }//GEN-LAST:event_VtableMouseClicked 507 | 508 | private void sidepaneMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sidepaneMouseEntered 509 | // TODO add your handling code here: 510 | 511 | // 512 | }//GEN-LAST:event_sidepaneMouseEntered 513 | 514 | private void formMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseEntered 515 | 516 | }//GEN-LAST:event_formMouseEntered 517 | 518 | /** 519 | * @param args the command line arguments 520 | */ 521 | public static void main(String args[]) { 522 | /* Set the Nimbus look and feel */ 523 | //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> 524 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 525 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 526 | */ 527 | try { 528 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 529 | if ("Nimbus".equals(info.getName())) { 530 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 531 | break; 532 | } 533 | } 534 | } catch (ClassNotFoundException ex) { 535 | java.util.logging.Logger.getLogger(Vechicle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 536 | } catch (InstantiationException ex) { 537 | java.util.logging.Logger.getLogger(Vechicle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 538 | } catch (IllegalAccessException ex) { 539 | java.util.logging.Logger.getLogger(Vechicle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 540 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 541 | java.util.logging.Logger.getLogger(Vechicle.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 542 | } 543 | //</editor-fold> 544 | 545 | /* Create and display the form */ 546 | java.awt.EventQueue.invokeLater(new Runnable() { 547 | public void run() { 548 | new Vechicle().setVisible(true); 549 | } 550 | }); 551 | } 552 | 553 | // Variables declaration - do not modify//GEN-BEGIN:variables 554 | private javax.swing.JButton Addbtn; 555 | private javax.swing.JLabel Back; 556 | private javax.swing.JButton Clrbtn; 557 | private javax.swing.JButton Delbtn; 558 | private javax.swing.JButton Modbtn; 559 | private javax.swing.JTextField Regno; 560 | private javax.swing.JTextField Vname; 561 | private javax.swing.JTable Vtable; 562 | private javax.swing.JTextField Vtype; 563 | private javax.swing.JLabel back; 564 | private javax.swing.JPanel bg; 565 | private javax.swing.JTextField cap; 566 | private javax.swing.JPanel header; 567 | private javax.swing.JLabel jLabel2; 568 | private javax.swing.JLabel jLabel3; 569 | private javax.swing.JLabel jLabel4; 570 | private javax.swing.JLabel jLabel5; 571 | private javax.swing.JLabel jLabel6; 572 | private javax.swing.JLabel jLabel7; 573 | private javax.swing.JScrollPane scrolvehicletable; 574 | private javax.swing.JPanel sidepane; 575 | // End of variables declaration//GEN-END:variables 576 | } 577 | 578 | -------------------------------------------------------------------------------- /src/TAMS/Confirm_book.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="false"/> 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 | <Component id="jPanel1" pref="736" max="32767" attributes="0"/> 28 | <EmptySpace max="-2" attributes="0"/> 29 | </Group> 30 | </Group> 31 | </DimensionLayout> 32 | <DimensionLayout dim="1"> 33 | <Group type="103" groupAlignment="0" attributes="0"> 34 | <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> 35 | </Group> 36 | </DimensionLayout> 37 | </Layout> 38 | <SubComponents> 39 | <Container class="javax.swing.JPanel" name="jPanel1"> 40 | <Properties> 41 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 42 | <Color blue="33" green="0" red="0" type="rgb"/> 43 | </Property> 44 | </Properties> 45 | 46 | <Layout> 47 | <DimensionLayout dim="0"> 48 | <Group type="103" groupAlignment="0" attributes="0"> 49 | <Group type="102" alignment="0" attributes="0"> 50 | <EmptySpace min="-2" pref="55" max="-2" attributes="0"/> 51 | <Group type="103" groupAlignment="0" attributes="0"> 52 | <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> 53 | <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> 54 | <Group type="102" alignment="1" attributes="0"> 55 | <Group type="103" groupAlignment="0" attributes="0"> 56 | <Group type="102" alignment="1" attributes="0"> 57 | <Group type="103" groupAlignment="1" attributes="0"> 58 | <Group type="102" attributes="0"> 59 | <Component id="jLabel3" min="-2" max="-2" attributes="0"/> 60 | <EmptySpace min="-2" pref="85" max="-2" attributes="0"/> 61 | </Group> 62 | <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> 63 | </Group> 64 | <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> 65 | <Group type="103" groupAlignment="0" max="-2" attributes="0"> 66 | <Group type="102" attributes="0"> 67 | <Group type="103" groupAlignment="0" attributes="0"> 68 | <Component id="Tid3" min="-2" pref="45" max="-2" attributes="0"/> 69 | <Component id="Tid4" min="-2" pref="45" max="-2" attributes="0"/> 70 | </Group> 71 | <EmptySpace min="-2" pref="31" max="-2" attributes="0"/> 72 | <Group type="103" groupAlignment="0" max="-2" attributes="0"> 73 | <Component id="comboeid" min="-2" pref="198" max="-2" attributes="0"/> 74 | <Component id="combovid" min="-2" pref="198" max="-2" attributes="0"/> 75 | </Group> 76 | </Group> 77 | <Component id="Cid2" min="-2" pref="274" max="-2" attributes="0"/> 78 | <Component id="Tid6" alignment="0" min="-2" pref="271" max="-2" attributes="0"/> 79 | </Group> 80 | </Group> 81 | <Group type="102" alignment="1" attributes="0"> 82 | <Group type="103" groupAlignment="0" attributes="0"> 83 | <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> 84 | <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> 85 | <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> 86 | </Group> 87 | <EmptySpace min="-2" pref="132" max="-2" attributes="0"/> 88 | <Group type="103" groupAlignment="1" attributes="0"> 89 | <Group type="103" groupAlignment="0" max="-2" attributes="0"> 90 | <Component id="Tid2" min="-2" pref="275" max="-2" attributes="0"/> 91 | <Component id="amount" alignment="0" min="-2" pref="275" max="-2" attributes="0"/> 92 | </Group> 93 | <Component id="Cdate" min="-2" pref="274" max="-2" attributes="0"/> 94 | </Group> 95 | </Group> 96 | </Group> 97 | <EmptySpace min="1" pref="1" max="-2" attributes="0"/> 98 | </Group> 99 | </Group> 100 | <Group type="103" groupAlignment="0" attributes="0"> 101 | <Group type="102" attributes="0"> 102 | <Group type="103" groupAlignment="0" attributes="0"> 103 | <Component id="disp3" min="-2" pref="157" max="-2" attributes="0"/> 104 | <Component id="disp2" min="-2" pref="166" max="-2" attributes="0"/> 105 | <Component id="disp1" alignment="0" min="-2" pref="166" max="-2" attributes="0"/> 106 | </Group> 107 | <EmptySpace min="-2" pref="107" max="-2" attributes="0"/> 108 | </Group> 109 | <Group type="102" attributes="0"> 110 | <Group type="103" groupAlignment="0" attributes="0"> 111 | <Group type="102" alignment="0" attributes="0"> 112 | <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> 113 | <Component id="Calculate" min="-2" max="-2" attributes="0"/> 114 | </Group> 115 | <Component id="disp0" alignment="0" min="-2" pref="166" max="-2" attributes="0"/> 116 | </Group> 117 | <EmptySpace max="32767" attributes="0"/> 118 | </Group> 119 | </Group> 120 | </Group> 121 | <Component id="header" alignment="0" max="32767" attributes="0"/> 122 | <Group type="102" alignment="0" attributes="0"> 123 | <EmptySpace min="-2" pref="250" max="-2" attributes="0"/> 124 | <Component id="Bookbtn" min="-2" max="-2" attributes="0"/> 125 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 126 | </Group> 127 | </Group> 128 | </DimensionLayout> 129 | <DimensionLayout dim="1"> 130 | <Group type="103" groupAlignment="0" attributes="0"> 131 | <Group type="102" alignment="0" attributes="0"> 132 | <Component id="header" min="-2" max="-2" attributes="0"/> 133 | <EmptySpace min="-2" pref="55" max="-2" attributes="0"/> 134 | <Group type="103" groupAlignment="0" attributes="0"> 135 | <Group type="102" attributes="0"> 136 | <Group type="103" groupAlignment="0" attributes="0"> 137 | <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 138 | <Component id="Tid6" min="-2" max="-2" attributes="0"/> 139 | </Group> 140 | <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> 141 | <Group type="103" groupAlignment="3" attributes="0"> 142 | <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> 143 | <Component id="Cid2" alignment="3" min="-2" max="-2" attributes="0"/> 144 | </Group> 145 | </Group> 146 | <Group type="102" attributes="0"> 147 | <Component id="disp0" min="-2" pref="33" max="-2" attributes="0"/> 148 | <EmptySpace max="32767" attributes="0"/> 149 | <Component id="disp1" min="-2" pref="33" max="-2" attributes="0"/> 150 | </Group> 151 | </Group> 152 | <Group type="103" groupAlignment="1" max="-2" attributes="0"> 153 | <Group type="102" alignment="1" attributes="0"> 154 | <EmptySpace min="-2" pref="4" max="-2" attributes="0"/> 155 | <Component id="disp2" min="-2" pref="30" max="-2" attributes="0"/> 156 | <EmptySpace max="-2" attributes="0"/> 157 | <Component id="disp3" min="-2" pref="34" max="-2" attributes="0"/> 158 | <EmptySpace max="-2" attributes="0"/> 159 | <Group type="103" groupAlignment="3" attributes="0"> 160 | <Component id="Tid4" alignment="3" min="-2" pref="25" max="-2" attributes="0"/> 161 | <Component id="comboeid" alignment="3" min="-2" max="-2" attributes="0"/> 162 | </Group> 163 | </Group> 164 | <Group type="102" alignment="1" attributes="0"> 165 | <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> 166 | <Group type="103" groupAlignment="3" attributes="0"> 167 | <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> 168 | <Component id="Tid3" alignment="3" min="-2" pref="25" max="-2" attributes="0"/> 169 | <Component id="combovid" alignment="3" min="-2" max="-2" attributes="0"/> 170 | </Group> 171 | <EmptySpace max="32767" attributes="0"/> 172 | <Component id="jLabel3" min="-2" max="-2" attributes="0"/> 173 | </Group> 174 | </Group> 175 | <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> 176 | <Group type="103" groupAlignment="0" attributes="0"> 177 | <Component id="jLabel7" min="-2" max="-2" attributes="0"/> 178 | <Component id="Cdate" min="-2" max="-2" attributes="0"/> 179 | </Group> 180 | <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> 181 | <Group type="103" groupAlignment="0" attributes="0"> 182 | <Component id="Calculate" alignment="1" min="-2" pref="31" max="-2" attributes="0"/> 183 | <Group type="103" groupAlignment="3" attributes="0"> 184 | <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> 185 | <Component id="Tid2" alignment="3" min="-2" max="-2" attributes="0"/> 186 | </Group> 187 | </Group> 188 | <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> 189 | <Group type="103" groupAlignment="0" attributes="0"> 190 | <Component id="jLabel5" min="-2" max="-2" attributes="0"/> 191 | <Component id="amount" min="-2" max="-2" attributes="0"/> 192 | </Group> 193 | <EmptySpace min="-2" pref="65" max="-2" attributes="0"/> 194 | <Component id="Bookbtn" min="-2" pref="36" max="-2" attributes="0"/> 195 | <EmptySpace min="-2" pref="43" max="-2" attributes="0"/> 196 | </Group> 197 | </Group> 198 | </DimensionLayout> 199 | </Layout> 200 | <SubComponents> 201 | <Container class="javax.swing.JPanel" name="header"> 202 | <Properties> 203 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 204 | <Color blue="99" green="0" red="66" type="rgb"/> 205 | </Property> 206 | </Properties> 207 | <Events> 208 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="headerMouseClicked"/> 209 | </Events> 210 | 211 | <Layout> 212 | <DimensionLayout dim="0"> 213 | <Group type="103" groupAlignment="0" attributes="0"> 214 | <Group type="102" alignment="0" attributes="0"> 215 | <EmptySpace min="-2" pref="246" max="-2" attributes="0"/> 216 | <Component id="jLabel11" min="-2" pref="274" max="-2" attributes="0"/> 217 | <EmptySpace max="32767" attributes="0"/> 218 | </Group> 219 | </Group> 220 | </DimensionLayout> 221 | <DimensionLayout dim="1"> 222 | <Group type="103" groupAlignment="0" attributes="0"> 223 | <Group type="102" alignment="1" attributes="0"> 224 | <EmptySpace max="32767" attributes="0"/> 225 | <Component id="jLabel11" min="-2" max="-2" attributes="0"/> 226 | <EmptySpace max="-2" attributes="0"/> 227 | </Group> 228 | </Group> 229 | </DimensionLayout> 230 | </Layout> 231 | <SubComponents> 232 | <Component class="javax.swing.JLabel" name="jLabel11"> 233 | <Properties> 234 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 235 | <Font name="Segoe UI" size="22" style="1"/> 236 | </Property> 237 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 238 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 239 | </Property> 240 | <Property name="text" type="java.lang.String" value="CONFIRM BOOKING"/> 241 | </Properties> 242 | </Component> 243 | </SubComponents> 244 | </Container> 245 | <Component class="javax.swing.JLabel" name="jLabel2"> 246 | <Properties> 247 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 248 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 249 | </Property> 250 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 251 | <Font name="Segoe UI" size="18" style="1"/> 252 | </Property> 253 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 254 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 255 | </Property> 256 | <Property name="text" type="java.lang.String" value="Trip ID "/> 257 | </Properties> 258 | </Component> 259 | <Component class="javax.swing.JLabel" name="jLabel4"> 260 | <Properties> 261 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 262 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 263 | </Property> 264 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 265 | <Font name="Segoe UI" size="18" style="1"/> 266 | </Property> 267 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 268 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 269 | </Property> 270 | <Property name="text" type="java.lang.String" value="Customer ID "/> 271 | </Properties> 272 | </Component> 273 | <Component class="javax.swing.JLabel" name="jLabel1"> 274 | <Properties> 275 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 276 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 277 | </Property> 278 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 279 | <Font name="Segoe UI" size="18" style="1"/> 280 | </Property> 281 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 282 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 283 | </Property> 284 | <Property name="text" type="java.lang.String" value="Vechicle ID "/> 285 | </Properties> 286 | </Component> 287 | <Component class="javax.swing.JLabel" name="jLabel3"> 288 | <Properties> 289 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 290 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 291 | </Property> 292 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 293 | <Font name="Segoe UI" size="18" style="1"/> 294 | </Property> 295 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 296 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 297 | </Property> 298 | <Property name="text" type="java.lang.String" value="Employee ID "/> 299 | </Properties> 300 | </Component> 301 | <Component class="javax.swing.JButton" name="Bookbtn"> 302 | <Properties> 303 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 304 | <Font name="Segoe UI" size="18" style="1"/> 305 | </Property> 306 | <Property name="text" type="java.lang.String" value="CONFIRM BOOKING"/> 307 | </Properties> 308 | <Events> 309 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="BookbtnActionPerformed"/> 310 | </Events> 311 | </Component> 312 | <Component class="javax.swing.JTextField" name="Tid2"> 313 | <Events> 314 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="Tid2ActionPerformed"/> 315 | </Events> 316 | </Component> 317 | <Component class="javax.swing.JTextField" name="Tid3"> 318 | <Events> 319 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="Tid3ActionPerformed"/> 320 | </Events> 321 | </Component> 322 | <Component class="javax.swing.JTextField" name="Tid4"> 323 | <Events> 324 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="Tid4ActionPerformed"/> 325 | </Events> 326 | </Component> 327 | <Component class="javax.swing.JLabel" name="jLabel6"> 328 | <Properties> 329 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 330 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 331 | </Property> 332 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 333 | <Font name="Segoe UI" size="18" style="1"/> 334 | </Property> 335 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 336 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 337 | </Property> 338 | <Property name="text" type="java.lang.String" value="Distance"/> 339 | </Properties> 340 | </Component> 341 | <Component class="javax.swing.JTextField" name="amount"> 342 | <Events> 343 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="amountActionPerformed"/> 344 | </Events> 345 | </Component> 346 | <Component class="javax.swing.JLabel" name="jLabel5"> 347 | <Properties> 348 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 349 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 350 | </Property> 351 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 352 | <Font name="Segoe UI" size="18" style="1"/> 353 | </Property> 354 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 355 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 356 | </Property> 357 | <Property name="text" type="java.lang.String" value="Amount"/> 358 | </Properties> 359 | </Component> 360 | <Component class="javax.swing.JComboBox" name="combovid"> 361 | <Properties> 362 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 363 | <StringArray count="0"/> 364 | </Property> 365 | </Properties> 366 | <Events> 367 | <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="combovidItemStateChanged"/> 368 | <EventHandler event="popupMenuWillBecomeInvisible" listener="javax.swing.event.PopupMenuListener" parameters="javax.swing.event.PopupMenuEvent" handler="combovidPopupMenuWillBecomeInvisible"/> 369 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="combovidActionPerformed"/> 370 | </Events> 371 | <AuxValues> 372 | <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 373 | </AuxValues> 374 | </Component> 375 | <Component class="javax.swing.JComboBox" name="comboeid"> 376 | <Properties> 377 | <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 378 | <StringArray count="0"/> 379 | </Property> 380 | </Properties> 381 | <Events> 382 | <EventHandler event="popupMenuWillBecomeInvisible" listener="javax.swing.event.PopupMenuListener" parameters="javax.swing.event.PopupMenuEvent" handler="comboeidPopupMenuWillBecomeInvisible"/> 383 | </Events> 384 | <AuxValues> 385 | <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 386 | </AuxValues> 387 | </Component> 388 | <Component class="javax.swing.JLabel" name="disp2"> 389 | <Properties> 390 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 391 | <Font name="Times New Roman" size="14" style="1"/> 392 | </Property> 393 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 394 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 395 | </Property> 396 | </Properties> 397 | </Component> 398 | <Component class="javax.swing.JLabel" name="disp1"> 399 | <Properties> 400 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 401 | <Font name="Times New Roman" size="14" style="1"/> 402 | </Property> 403 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 404 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 405 | </Property> 406 | </Properties> 407 | </Component> 408 | <Component class="javax.swing.JLabel" name="disp3"> 409 | <Properties> 410 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 411 | <Font name="Times New Roman" size="14" style="1"/> 412 | </Property> 413 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 414 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 415 | </Property> 416 | </Properties> 417 | </Component> 418 | <Component class="javax.swing.JLabel" name="jLabel7"> 419 | <Properties> 420 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 421 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 422 | </Property> 423 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 424 | <Font name="Segoe UI" size="18" style="1"/> 425 | </Property> 426 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 427 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 428 | </Property> 429 | <Property name="text" type="java.lang.String" value="Date"/> 430 | </Properties> 431 | </Component> 432 | <Component class="java.awt.Button" name="Calculate"> 433 | <Properties> 434 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 435 | <Font name="Segoe UI" size="12" style="1"/> 436 | </Property> 437 | <Property name="label" type="java.lang.String" value="CALCULATE"/> 438 | </Properties> 439 | <Events> 440 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="CalculateActionPerformed"/> 441 | </Events> 442 | </Component> 443 | <Component class="javax.swing.JLabel" name="disp0"> 444 | <Properties> 445 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 446 | <Font name="Times New Roman" size="14" style="1"/> 447 | </Property> 448 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 449 | <Color blue="ff" green="ff" red="ff" type="rgb"/> 450 | </Property> 451 | </Properties> 452 | </Component> 453 | <Component class="javax.swing.JTextField" name="Cid2"> 454 | <Properties> 455 | <Property name="text" type="java.lang.String" value="jTextField1"/> 456 | </Properties> 457 | <Events> 458 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="Cid2ActionPerformed"/> 459 | </Events> 460 | <AuxValues> 461 | <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/> 462 | </AuxValues> 463 | </Component> 464 | <Component class="javax.swing.JTextField" name="Tid6"> 465 | <Events> 466 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="Tid6ActionPerformed"/> 467 | </Events> 468 | <AuxValues> 469 | <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/> 470 | </AuxValues> 471 | </Component> 472 | <Component class="org.jdesktop.swingx.JXDatePicker" name="Cdate"> 473 | <AuxValues> 474 | <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/> 475 | </AuxValues> 476 | </Component> 477 | </SubComponents> 478 | </Container> 479 | </SubComponents> 480 | </Form> 481 | --------------------------------------------------------------------------------