├── MallaComputers_database.CSV
├── README.md
├── build.xml
├── build
├── built-jar.properties
└── classes
│ ├── .netbeans_automatic_build
│ ├── .netbeans_update_resources
│ └── AppliancesInfo
│ ├── AppliancesInfo$1.class
│ ├── AppliancesInfo$10.class
│ ├── AppliancesInfo$11.class
│ ├── AppliancesInfo$12.class
│ ├── AppliancesInfo$13.class
│ ├── AppliancesInfo$14.class
│ ├── AppliancesInfo$15.class
│ ├── AppliancesInfo$16.class
│ ├── AppliancesInfo$17.class
│ ├── AppliancesInfo$18.class
│ ├── AppliancesInfo$19.class
│ ├── AppliancesInfo$2.class
│ ├── AppliancesInfo$20.class
│ ├── AppliancesInfo$21.class
│ ├── AppliancesInfo$22.class
│ ├── AppliancesInfo$23.class
│ ├── AppliancesInfo$24.class
│ ├── AppliancesInfo$3.class
│ ├── AppliancesInfo$4.class
│ ├── AppliancesInfo$5.class
│ ├── AppliancesInfo$6.class
│ ├── AppliancesInfo$7.class
│ ├── AppliancesInfo$8.class
│ ├── AppliancesInfo$9.class
│ ├── AppliancesInfo.class
│ ├── AppliancesInfo.form
│ └── TableRows.class
├── dist
├── Appliances_IS.jar
└── README.TXT
├── manifest.mf
├── nbproject
├── build-impl.xml
├── genfiles.properties
├── private
│ ├── private.properties
│ └── private.xml
├── project.properties
└── project.xml
├── rights_reserved.pdf
├── src
└── AppliancesInfo
│ ├── AppliancesInfo.form
│ ├── AppliancesInfo.java
│ └── TableRows.java
└── usermanual.pdf
/MallaComputers_database.CSV:
--------------------------------------------------------------------------------
1 | L1002,Microsoft Software Surface Pro 7,Business,Budget,Laptop,589
2 | L1012,Dell Inspire 13 5000 (5391),Home use,Budget,Laptop,599
3 | L1010,HP Pavilion x360,Home use,Budget,Convertible,620
4 | L1009,Acer Aspire 3,Home use,Budget,Laptop,620
5 | L1005,Dell G3 15,Gaming,Budget,Laptop,729
6 | L1020,Lenovo Ideapad 7,Customized,Budget,Laptop,800
7 | L1011,Acer Swift 3,Home use,Budget,Laptop,864
8 | L1013,Apple MacBook Air,High performance,Budget,Laptop,999
9 | L1014,Dell XPS 15,High performance,Mid,Laptop,1149
10 | L1015,HP spectre x360,High performance,Mid,Laptop,1149
11 | L1019,Lenovo Chromebook C340-11,Customized,Mid,Laptop,1200
12 | L1018,Dell Chromebook 3100 Education,Customized,Mid,Laptop,1200
13 | L1007,Asus Rog Zephyrus G14,Gaming,Mid,Laptop,1269
14 | L1006,Acer Predator Helios 300,Gaming,Mid,Laptop,1269
15 | L1008,MSI gs65 Stealth Thin,Gaming,Mid,Laptop,1599
16 | L1001,FTP Elite Dragonfly,Business,Mid,Laptop,1799
17 | L1003,Dell Latitude 9410 2-in-1,Business,Mid,Convertible,1799
18 | L1004,Acer Nitro 5,Gaming,High,Laptop,2200
19 | L1000,Lenovo ThinkPad x1 Carbon (8th Gen) ,Business,High,Laptop,2200
20 | L1016,Lg gram 17,High performance,High,Convertible,2500
21 | L1017,Asus Vivobook 15.6 inch,Customized,High,Convertible,2600
22 | L1021,HP Omen Obelisk,Customized,High,Desktop,2700
23 | L1022,iMac 21.54K,High performance,High,Desktop,5400
24 | L1023,iMac 2019 24 inch,High performance,High,Desktop,6200
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Laptop-Inventory-System--Java-programming
2 | An inventory system made using java programming language that stores the details and prices of various laptops.
3 |
--------------------------------------------------------------------------------
/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Builds, tests, and runs the project Appliances_IS.
12 |
13 |
73 |
74 |
--------------------------------------------------------------------------------
/build/built-jar.properties:
--------------------------------------------------------------------------------
1 | #Fri, 15 Jan 2021 17:48:31 +0545
2 |
3 |
4 | C\:\\Users\\Aadesh\\Desktop\\Classes\\Emerging\\Java\\Appliances_IS=
5 |
--------------------------------------------------------------------------------
/build/classes/.netbeans_automatic_build:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/.netbeans_automatic_build
--------------------------------------------------------------------------------
/build/classes/.netbeans_update_resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/.netbeans_update_resources
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$1.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$10.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$10.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$11.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$11.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$12.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$12.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$13.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$13.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$14.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$14.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$15.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$15.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$16.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$16.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$17.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$17.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$18.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$18.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$19.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$19.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$2.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$20.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$20.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$21.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$21.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$22.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$22.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$23.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$23.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$24.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$24.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$3.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$3.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$4.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$4.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$5.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$5.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$6.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$6.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$7.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$7.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$8.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$8.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo$9.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo$9.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/AppliancesInfo.class
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/AppliancesInfo.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
699 |
--------------------------------------------------------------------------------
/build/classes/AppliancesInfo/TableRows.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/build/classes/AppliancesInfo/TableRows.class
--------------------------------------------------------------------------------
/dist/Appliances_IS.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/dist/Appliances_IS.jar
--------------------------------------------------------------------------------
/dist/README.TXT:
--------------------------------------------------------------------------------
1 | ========================
2 | BUILD OUTPUT DESCRIPTION
3 | ========================
4 |
5 | When you build an Java application project that has a main class, the IDE
6 | automatically copies all of the JAR
7 | files on the projects classpath to your projects dist/lib folder. The IDE
8 | also adds each of the JAR files to the Class-Path element in the application
9 | JAR files manifest file (MANIFEST.MF).
10 |
11 | To run the project from the command line, go to the dist folder and
12 | type the following:
13 |
14 | java -jar "Appliances_IS.jar"
15 |
16 | To distribute this project, zip up the dist folder (including the lib folder)
17 | and distribute the ZIP file.
18 |
19 | Notes:
20 |
21 | * If two JAR files on the project classpath have the same name, only the first
22 | JAR file is copied to the lib folder.
23 | * Only JAR files are copied to the lib folder.
24 | If the classpath contains other types of files or folders, these files (folders)
25 | are not copied.
26 | * If a library on the projects classpath also has a Class-Path element
27 | specified in the manifest,the content of the Class-Path element has to be on
28 | the projects runtime path.
29 | * To set a main class in a standard Java project, right-click the project node
30 | in the Projects window and choose Properties. Then click Run and enter the
31 | class name in the Main Class field. Alternatively, you can manually type the
32 | class name in the manifest Main-Class element.
33 |
--------------------------------------------------------------------------------
/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=ad3202fd
2 | build.xml.script.CRC32=ccf64a5b
3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=ad3202fd
7 | nbproject/build-impl.xml.script.CRC32=c5a7343e
8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
9 |
--------------------------------------------------------------------------------
/nbproject/private/private.properties:
--------------------------------------------------------------------------------
1 | compile.on.save=true
2 | user.properties.file=C:\\Users\\Aadesh\\AppData\\Roaming\\NetBeans\\8.2rc\\build.properties
3 |
--------------------------------------------------------------------------------
/nbproject/private/private.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | file:/C:/Users/Aadesh/Desktop/Classes/Emerging/Java/Appliances_IS/src/AppliancesInfo/TableRows.java
7 | file:/C:/Users/Aadesh/Desktop/Classes/Emerging/Java/Appliances_IS/src/AppliancesInfo/AppliancesInfo.java
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=false
3 | annotation.processing.processor.options=
4 | annotation.processing.processors.list=
5 | annotation.processing.run.all.processors=true
6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
7 | build.classes.dir=${build.dir}/classes
8 | build.classes.excludes=**/*.java,**/*.form
9 | # This directory is removed when the project is cleaned:
10 | build.dir=build
11 | build.generated.dir=${build.dir}/generated
12 | build.generated.sources.dir=${build.dir}/generated-sources
13 | # Only compile against the classpath explicitly listed here:
14 | build.sysclasspath=ignore
15 | build.test.classes.dir=${build.dir}/test/classes
16 | build.test.results.dir=${build.dir}/test/results
17 | # Uncomment to specify the preferred debugger connection transport:
18 | #debug.transport=dt_socket
19 | debug.classpath=\
20 | ${run.classpath}
21 | debug.test.classpath=\
22 | ${run.test.classpath}
23 | # Files in build.classes.dir which should be excluded from distribution jar
24 | dist.archive.excludes=
25 | # This directory is removed when the project is cleaned:
26 | dist.dir=dist
27 | dist.jar=${dist.dir}/Appliances_IS.jar
28 | dist.javadoc.dir=${dist.dir}/javadoc
29 | excludes=
30 | includes=**
31 | jar.compress=false
32 | javac.classpath=
33 | # Space-separated list of extra javac options
34 | javac.compilerargs=
35 | javac.deprecation=false
36 | javac.external.vm=true
37 | javac.processorpath=\
38 | ${javac.classpath}
39 | javac.source=1.8
40 | javac.target=1.8
41 | javac.test.classpath=\
42 | ${javac.classpath}:\
43 | ${build.classes.dir}
44 | javac.test.processorpath=\
45 | ${javac.test.classpath}
46 | javadoc.additionalparam=
47 | javadoc.author=false
48 | javadoc.encoding=${source.encoding}
49 | javadoc.noindex=false
50 | javadoc.nonavbar=false
51 | javadoc.notree=false
52 | javadoc.private=false
53 | javadoc.splitindex=true
54 | javadoc.use=true
55 | javadoc.version=false
56 | javadoc.windowtitle=
57 | main.class=AppliancesInfo.AppliancesInfo
58 | manifest.file=manifest.mf
59 | meta.inf.dir=${src.dir}/META-INF
60 | mkdist.disabled=false
61 | platform.active=default_platform
62 | run.classpath=\
63 | ${javac.classpath}:\
64 | ${build.classes.dir}
65 | # Space-separated list of JVM arguments used when running the project.
66 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
67 | # To set system properties for unit tests define test-sys-prop.name=value:
68 | run.jvmargs=
69 | run.test.classpath=\
70 | ${javac.test.classpath}:\
71 | ${build.test.classes.dir}
72 | source.encoding=UTF-8
73 | src.dir=src
74 | test.src.dir=test
75 |
--------------------------------------------------------------------------------
/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | Appliances_IS
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/rights_reserved.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/rights_reserved.pdf
--------------------------------------------------------------------------------
/src/AppliancesInfo/AppliancesInfo.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
699 |
--------------------------------------------------------------------------------
/src/AppliancesInfo/AppliancesInfo.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 AppliancesInfo;
7 |
8 | import java.io.BufferedReader;
9 | import java.io.File;
10 | import java.io.FileNotFoundException;
11 | import java.io.FileReader;
12 | import java.io.FileWriter;
13 | import java.io.IOException;
14 | import java.util.ArrayList;
15 | import java.util.Collections;
16 | import java.util.regex.Pattern;
17 | import javax.swing.JOptionPane;
18 | import javax.swing.JTable;
19 | import javax.swing.table.DefaultTableModel;
20 | import javax.swing.table.TableModel;
21 |
22 | /**
23 | *
24 | * @author Aadesh
25 | */
26 | public class AppliancesInfo extends javax.swing.JFrame {
27 |
28 | private String range;
29 |
30 | /**
31 | * Creates new form AppliancesInfo
32 | */
33 | public ArrayList list = new ArrayList();
34 | public AppliancesInfo() {
35 | initComponents();
36 | }
37 |
38 | /**
39 | * This method is called from within the constructor to initialize the form.
40 | * WARNING: Do NOT modify this code. The content of this method is always
41 | * regenerated by the Form Editor.
42 | */
43 | @SuppressWarnings("unchecked")
44 | // //GEN-BEGIN:initComponents
45 | private void initComponents() {
46 |
47 | range_BtnGrp = new javax.swing.ButtonGroup();
48 | jComboBox1 = new javax.swing.JComboBox<>();
49 | table_Panel = new javax.swing.JPanel();
50 | jLabel1 = new javax.swing.JLabel();
51 | jLabel2 = new javax.swing.JLabel();
52 | jLabel3 = new javax.swing.JLabel();
53 | jLabel4 = new javax.swing.JLabel();
54 | jLabel5 = new javax.swing.JLabel();
55 | add_Btn = new javax.swing.JButton();
56 | clear_Btn = new javax.swing.JButton();
57 | delete_Btn = new javax.swing.JButton();
58 | id_TF = new javax.swing.JTextField();
59 | name_TF = new javax.swing.JTextField();
60 | price_TF = new javax.swing.JTextField();
61 | Mid_RangeBtn = new javax.swing.JRadioButton();
62 | High_rangeBtn = new javax.swing.JRadioButton();
63 | Budget_rangeBTN = new javax.swing.JRadioButton();
64 | category_CB = new javax.swing.JComboBox<>();
65 | exit_Btn = new javax.swing.JButton();
66 | jLabel8 = new javax.swing.JLabel();
67 | type_CB = new javax.swing.JComboBox<>();
68 | jPanel1 = new javax.swing.JPanel();
69 | jScrollPane1 = new javax.swing.JScrollPane();
70 | computerIS_Tbl = new javax.swing.JTable();
71 | jPanel2 = new javax.swing.JPanel();
72 | priceSrch_TF = new javax.swing.JTextField();
73 | jLabel6 = new javax.swing.JLabel();
74 | priceSrch_Btn = new javax.swing.JButton();
75 | jLabel7 = new javax.swing.JLabel();
76 | categorySearch_CB = new javax.swing.JComboBox<>();
77 | SortList_Btn = new javax.swing.JButton();
78 | totalCategorySrch_CB = new javax.swing.JComboBox<>();
79 | jLabel9 = new javax.swing.JLabel();
80 | totalDevice = new javax.swing.JButton();
81 | jMenuBar1 = new javax.swing.JMenuBar();
82 | jMenu1 = new javax.swing.JMenu();
83 | openFile = new javax.swing.JRadioButtonMenuItem();
84 | importDB_MenuItem = new javax.swing.JMenuItem();
85 | close_menuItem = new javax.swing.JMenuItem();
86 | jMenu2 = new javax.swing.JMenu();
87 | UserManual = new javax.swing.JRadioButtonMenuItem();
88 |
89 | jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
90 |
91 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
92 | setTitle("Malla Computers");
93 |
94 | table_Panel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED), "Form"));
95 |
96 | jLabel1.setText("Device ID :");
97 |
98 | jLabel2.setText("Device name :");
99 |
100 | jLabel3.setText("Category :");
101 |
102 | jLabel4.setText("Range level :");
103 |
104 | jLabel5.setText("Price :");
105 |
106 | add_Btn.setBackground(new java.awt.Color(0, 102, 204));
107 | add_Btn.setForeground(new java.awt.Color(0, 0, 0));
108 | add_Btn.setText("Add Item");
109 | add_Btn.addActionListener(new java.awt.event.ActionListener() {
110 | public void actionPerformed(java.awt.event.ActionEvent evt) {
111 | add_BtnActionPerformed(evt);
112 | }
113 | });
114 |
115 | clear_Btn.setBackground(new java.awt.Color(0, 102, 204));
116 | clear_Btn.setText("Clear");
117 | clear_Btn.addActionListener(new java.awt.event.ActionListener() {
118 | public void actionPerformed(java.awt.event.ActionEvent evt) {
119 | clear_BtnActionPerformed(evt);
120 | }
121 | });
122 |
123 | delete_Btn.setBackground(new java.awt.Color(0, 102, 204));
124 | delete_Btn.setText("Delete");
125 | delete_Btn.addActionListener(new java.awt.event.ActionListener() {
126 | public void actionPerformed(java.awt.event.ActionEvent evt) {
127 | delete_BtnActionPerformed(evt);
128 | }
129 | });
130 |
131 | id_TF.addActionListener(new java.awt.event.ActionListener() {
132 | public void actionPerformed(java.awt.event.ActionEvent evt) {
133 | id_TFActionPerformed(evt);
134 | }
135 | });
136 | id_TF.addKeyListener(new java.awt.event.KeyAdapter() {
137 | public void keyTyped(java.awt.event.KeyEvent evt) {
138 | id_TFKeyTyped(evt);
139 | }
140 | });
141 |
142 | price_TF.addKeyListener(new java.awt.event.KeyAdapter() {
143 | public void keyTyped(java.awt.event.KeyEvent evt) {
144 | price_TFKeyTyped(evt);
145 | }
146 | });
147 |
148 | range_BtnGrp.add(Mid_RangeBtn);
149 | Mid_RangeBtn.setText("Mid");
150 | Mid_RangeBtn.addActionListener(new java.awt.event.ActionListener() {
151 | public void actionPerformed(java.awt.event.ActionEvent evt) {
152 | Mid_RangeBtnActionPerformed(evt);
153 | }
154 | });
155 |
156 | range_BtnGrp.add(High_rangeBtn);
157 | High_rangeBtn.setText("High");
158 | High_rangeBtn.addActionListener(new java.awt.event.ActionListener() {
159 | public void actionPerformed(java.awt.event.ActionEvent evt) {
160 | High_rangeBtnActionPerformed(evt);
161 | }
162 | });
163 |
164 | range_BtnGrp.add(Budget_rangeBTN);
165 | Budget_rangeBTN.setText("Budget");
166 | Budget_rangeBTN.addActionListener(new java.awt.event.ActionListener() {
167 | public void actionPerformed(java.awt.event.ActionEvent evt) {
168 | Budget_rangeBTNActionPerformed(evt);
169 | }
170 | });
171 |
172 | category_CB.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Gaming", "Home use", "Business", "High performance", "Customized" }));
173 | category_CB.addActionListener(new java.awt.event.ActionListener() {
174 | public void actionPerformed(java.awt.event.ActionEvent evt) {
175 | category_CBActionPerformed(evt);
176 | }
177 | });
178 |
179 | exit_Btn.setBackground(new java.awt.Color(0, 102, 204));
180 | exit_Btn.setText("Exit");
181 | exit_Btn.addActionListener(new java.awt.event.ActionListener() {
182 | public void actionPerformed(java.awt.event.ActionEvent evt) {
183 | exit_BtnActionPerformed(evt);
184 | }
185 | });
186 |
187 | jLabel8.setText("Type :");
188 |
189 | type_CB.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Desktop", "Laptop", "Convertible" }));
190 |
191 | javax.swing.GroupLayout table_PanelLayout = new javax.swing.GroupLayout(table_Panel);
192 | table_Panel.setLayout(table_PanelLayout);
193 | table_PanelLayout.setHorizontalGroup(
194 | table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
195 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, table_PanelLayout.createSequentialGroup()
196 | .addContainerGap(18, Short.MAX_VALUE)
197 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
198 | .addGroup(table_PanelLayout.createSequentialGroup()
199 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
200 | .addComponent(jLabel1)
201 | .addComponent(jLabel2)
202 | .addComponent(jLabel3)
203 | .addComponent(jLabel4)
204 | .addComponent(jLabel8)
205 | .addComponent(jLabel5))
206 | .addGap(67, 67, 67)
207 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
208 | .addComponent(price_TF, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE)
209 | .addComponent(type_CB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
210 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
211 | .addGroup(table_PanelLayout.createSequentialGroup()
212 | .addComponent(Budget_rangeBTN)
213 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
214 | .addComponent(High_rangeBtn))
215 | .addComponent(id_TF)
216 | .addComponent(name_TF, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE))
217 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
218 | .addComponent(Mid_RangeBtn)
219 | .addComponent(category_CB, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))))
220 | .addGroup(table_PanelLayout.createSequentialGroup()
221 | .addComponent(add_Btn)
222 | .addGap(30, 30, 30)
223 | .addComponent(clear_Btn)
224 | .addGap(30, 30, 30)
225 | .addComponent(delete_Btn)
226 | .addGap(30, 30, 30)
227 | .addComponent(exit_Btn)))
228 | .addGap(58, 58, 58))
229 | );
230 | table_PanelLayout.setVerticalGroup(
231 | table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
232 | .addGroup(table_PanelLayout.createSequentialGroup()
233 | .addContainerGap()
234 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
235 | .addComponent(jLabel1)
236 | .addComponent(id_TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
237 | .addGap(45, 45, 45)
238 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
239 | .addComponent(jLabel2)
240 | .addComponent(name_TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
241 | .addGap(45, 45, 45)
242 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
243 | .addComponent(jLabel3)
244 | .addComponent(category_CB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
245 | .addGap(44, 44, 44)
246 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
247 | .addComponent(jLabel4)
248 | .addComponent(Mid_RangeBtn)
249 | .addComponent(High_rangeBtn)
250 | .addComponent(Budget_rangeBTN))
251 | .addGap(45, 45, 45)
252 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
253 | .addComponent(jLabel8)
254 | .addComponent(type_CB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
255 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
256 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
257 | .addComponent(jLabel5)
258 | .addComponent(price_TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
259 | .addGap(26, 26, 26)
260 | .addGroup(table_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
261 | .addComponent(add_Btn)
262 | .addComponent(clear_Btn)
263 | .addComponent(delete_Btn)
264 | .addComponent(exit_Btn))
265 | .addContainerGap())
266 | );
267 |
268 | jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED), "Personal Computer Information System", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Bahnschrift", 1, 16))); // NOI18N
269 |
270 | computerIS_Tbl.setModel(new javax.swing.table.DefaultTableModel(
271 | new Object [][] {
272 | {null, null, null, null, null, null},
273 | {null, null, null, null, null, null},
274 | {null, null, null, null, null, null},
275 | {null, null, null, null, null, null},
276 | {null, null, null, null, null, null},
277 | {null, null, null, null, null, null},
278 | {null, null, null, null, null, null},
279 | {null, null, null, null, null, null},
280 | {null, null, null, null, null, null},
281 | {null, null, null, null, null, null},
282 | {null, null, null, null, null, null},
283 | {null, null, null, null, null, null},
284 | {null, null, null, null, null, null},
285 | {null, null, null, null, null, null},
286 | {null, null, null, null, null, null},
287 | {null, null, null, null, null, null},
288 | {null, null, null, null, null, null},
289 | {null, null, null, null, null, null},
290 | {null, null, null, null, null, null},
291 | {null, null, null, null, null, null},
292 | {null, null, null, null, null, null},
293 | {null, null, null, null, null, null},
294 | {null, null, null, null, null, null},
295 | {null, null, null, null, null, null},
296 | {null, null, null, null, null, null},
297 | {null, null, null, null, null, null}
298 | },
299 | new String [] {
300 | "ID", "Name", "Category", "Range level", "Type", "Price"
301 | }
302 | ) {
303 | boolean[] canEdit = new boolean [] {
304 | false, false, false, false, false, false
305 | };
306 |
307 | public boolean isCellEditable(int rowIndex, int columnIndex) {
308 | return canEdit [columnIndex];
309 | }
310 | });
311 | jScrollPane1.setViewportView(computerIS_Tbl);
312 |
313 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
314 | jPanel1.setLayout(jPanel1Layout);
315 | jPanel1Layout.setHorizontalGroup(
316 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
317 | .addGroup(jPanel1Layout.createSequentialGroup()
318 | .addContainerGap()
319 | .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 727, Short.MAX_VALUE)
320 | .addContainerGap())
321 | );
322 | jPanel1Layout.setVerticalGroup(
323 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
324 | .addGroup(jPanel1Layout.createSequentialGroup()
325 | .addContainerGap()
326 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
327 | .addContainerGap(15, Short.MAX_VALUE))
328 | );
329 |
330 | jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED), "Search"));
331 |
332 | priceSrch_TF.addActionListener(new java.awt.event.ActionListener() {
333 | public void actionPerformed(java.awt.event.ActionEvent evt) {
334 | priceSrch_TFActionPerformed(evt);
335 | }
336 | });
337 | priceSrch_TF.addKeyListener(new java.awt.event.KeyAdapter() {
338 | public void keyTyped(java.awt.event.KeyEvent evt) {
339 | priceSrch_TFKeyTyped(evt);
340 | }
341 | });
342 |
343 | jLabel6.setText("Device Price :");
344 |
345 | priceSrch_Btn.setBackground(new java.awt.Color(0, 102, 204));
346 | priceSrch_Btn.setText("Search device");
347 | priceSrch_Btn.addActionListener(new java.awt.event.ActionListener() {
348 | public void actionPerformed(java.awt.event.ActionEvent evt) {
349 | priceSrch_BtnActionPerformed(evt);
350 | }
351 | });
352 |
353 | jLabel7.setText("Device category :");
354 |
355 | categorySearch_CB.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "(Optional)", "Gaming", "Home use", "Business", "High performance", "Customized" }));
356 | categorySearch_CB.addActionListener(new java.awt.event.ActionListener() {
357 | public void actionPerformed(java.awt.event.ActionEvent evt) {
358 | categorySearch_CBActionPerformed(evt);
359 | }
360 | });
361 |
362 | SortList_Btn.setBackground(new java.awt.Color(0, 102, 204));
363 | SortList_Btn.setText("Sort List");
364 | SortList_Btn.addActionListener(new java.awt.event.ActionListener() {
365 | public void actionPerformed(java.awt.event.ActionEvent evt) {
366 | SortList_BtnActionPerformed(evt);
367 | }
368 | });
369 |
370 | totalCategorySrch_CB.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Gaming", "Home use", "Business", "High performance", "Customized" }));
371 | totalCategorySrch_CB.addActionListener(new java.awt.event.ActionListener() {
372 | public void actionPerformed(java.awt.event.ActionEvent evt) {
373 | totalCategorySrch_CBActionPerformed(evt);
374 | }
375 | });
376 |
377 | jLabel9.setText("Find total devices in a category");
378 |
379 | totalDevice.setBackground(new java.awt.Color(0, 102, 204));
380 | totalDevice.setText("Find");
381 | totalDevice.addActionListener(new java.awt.event.ActionListener() {
382 | public void actionPerformed(java.awt.event.ActionEvent evt) {
383 | totalDeviceActionPerformed(evt);
384 | }
385 | });
386 |
387 | javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
388 | jPanel2.setLayout(jPanel2Layout);
389 | jPanel2Layout.setHorizontalGroup(
390 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
391 | .addGroup(jPanel2Layout.createSequentialGroup()
392 | .addContainerGap()
393 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
394 | .addGroup(jPanel2Layout.createSequentialGroup()
395 | .addComponent(priceSrch_Btn, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE)
396 | .addGap(32, 32, 32)
397 | .addComponent(SortList_Btn, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
398 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
399 | .addComponent(totalDevice, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
400 | .addGap(83, 83, 83))
401 | .addGroup(jPanel2Layout.createSequentialGroup()
402 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
403 | .addComponent(jLabel6)
404 | .addComponent(jLabel7))
405 | .addGap(47, 47, 47)
406 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
407 | .addComponent(categorySearch_CB, 0, 177, Short.MAX_VALUE)
408 | .addComponent(priceSrch_TF))
409 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
410 | .addGroup(jPanel2Layout.createSequentialGroup()
411 | .addGap(177, 177, 177)
412 | .addComponent(jLabel9)
413 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
414 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
415 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
416 | .addComponent(totalCategorySrch_CB, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
417 | .addGap(37, 37, 37))))))
418 | );
419 | jPanel2Layout.setVerticalGroup(
420 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
421 | .addGroup(jPanel2Layout.createSequentialGroup()
422 | .addGap(29, 29, 29)
423 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
424 | .addGroup(jPanel2Layout.createSequentialGroup()
425 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
426 | .addComponent(jLabel6)
427 | .addComponent(priceSrch_TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
428 | .addGap(18, 18, 18)
429 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
430 | .addComponent(jLabel7)
431 | .addComponent(categorySearch_CB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
432 | .addGroup(jPanel2Layout.createSequentialGroup()
433 | .addGap(1, 1, 1)
434 | .addComponent(jLabel9)
435 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
436 | .addComponent(totalCategorySrch_CB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
437 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
438 | .addGroup(jPanel2Layout.createSequentialGroup()
439 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
440 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
441 | .addComponent(priceSrch_Btn)
442 | .addComponent(totalDevice))
443 | .addGap(26, 26, 26))
444 | .addGroup(jPanel2Layout.createSequentialGroup()
445 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
446 | .addComponent(SortList_Btn)
447 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
448 | );
449 |
450 | jMenu1.setText("File");
451 |
452 | openFile.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
453 | openFile.setSelected(true);
454 | openFile.setText("Open");
455 | openFile.addActionListener(new java.awt.event.ActionListener() {
456 | public void actionPerformed(java.awt.event.ActionEvent evt) {
457 | openFileActionPerformed(evt);
458 | }
459 | });
460 | jMenu1.add(openFile);
461 |
462 | importDB_MenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK));
463 | importDB_MenuItem.setText("Import Database file");
464 | importDB_MenuItem.addActionListener(new java.awt.event.ActionListener() {
465 | public void actionPerformed(java.awt.event.ActionEvent evt) {
466 | importDB_MenuItemActionPerformed(evt);
467 | }
468 | });
469 | jMenu1.add(importDB_MenuItem);
470 |
471 | close_menuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_BACK_SPACE, java.awt.event.InputEvent.CTRL_MASK));
472 | close_menuItem.setText("Close");
473 | close_menuItem.addActionListener(new java.awt.event.ActionListener() {
474 | public void actionPerformed(java.awt.event.ActionEvent evt) {
475 | close_menuItemActionPerformed(evt);
476 | }
477 | });
478 | jMenu1.add(close_menuItem);
479 |
480 | jMenuBar1.add(jMenu1);
481 |
482 | jMenu2.setText("Help");
483 |
484 | UserManual.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK));
485 | UserManual.setSelected(true);
486 | UserManual.setText("Open Manual");
487 | UserManual.addActionListener(new java.awt.event.ActionListener() {
488 | public void actionPerformed(java.awt.event.ActionEvent evt) {
489 | UserManualActionPerformed(evt);
490 | }
491 | });
492 | jMenu2.add(UserManual);
493 |
494 | jMenuBar1.add(jMenu2);
495 |
496 | setJMenuBar(jMenuBar1);
497 |
498 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
499 | getContentPane().setLayout(layout);
500 | layout.setHorizontalGroup(
501 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
502 | .addGroup(layout.createSequentialGroup()
503 | .addContainerGap()
504 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
505 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
506 | .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
507 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
508 | .addComponent(table_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
509 | .addContainerGap())
510 | );
511 | layout.setVerticalGroup(
512 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
513 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
514 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
515 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
516 | .addComponent(table_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
517 | .addGroup(layout.createSequentialGroup()
518 | .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
519 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
520 | .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
521 | .addGap(37, 37, 37))
522 | );
523 |
524 | pack();
525 | }// //GEN-END:initComponents
526 |
527 | private void id_TFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_id_TFActionPerformed
528 |
529 | }//GEN-LAST:event_id_TFActionPerformed
530 |
531 | private void Mid_RangeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Mid_RangeBtnActionPerformed
532 | // TODO add your handling code here:
533 | range = "Mid";
534 | }//GEN-LAST:event_Mid_RangeBtnActionPerformed
535 |
536 | private void High_rangeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_High_rangeBtnActionPerformed
537 | // TODO add your handling code here:
538 | range = "High";
539 | }//GEN-LAST:event_High_rangeBtnActionPerformed
540 |
541 | private void Budget_rangeBTNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Budget_rangeBTNActionPerformed
542 | // TODO add your handling code here:
543 | range = "Budget";
544 | }//GEN-LAST:event_Budget_rangeBTNActionPerformed
545 |
546 | private void exit_BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exit_BtnActionPerformed
547 | System.exit(0);
548 | }//GEN-LAST:event_exit_BtnActionPerformed
549 |
550 | private void priceSrch_TFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_priceSrch_TFActionPerformed
551 | // TODO add your handling code here:
552 | }//GEN-LAST:event_priceSrch_TFActionPerformed
553 |
554 | private void add_BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_add_BtnActionPerformed
555 | String deviceID = id_TF.getText().trim();
556 | String deviceName = name_TF.getText().trim();
557 | String devicePrice = price_TF.getText().trim();
558 | String deviceCategory = category_CB.getSelectedItem().toString();
559 | String deviceType = type_CB.getSelectedItem().toString();
560 | validation(deviceID, deviceName, devicePrice, deviceCategory, deviceType);
561 | loadToCSV();
562 | }//GEN-LAST:event_add_BtnActionPerformed
563 |
564 | private void priceSrch_BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_priceSrch_BtnActionPerformed
565 | String searchValue = priceSrch_TF.getText().trim();
566 | String searchCategory = categorySearch_CB.getSelectedItem().toString();
567 | search_device(searchValue, searchCategory);
568 | }//GEN-LAST:event_priceSrch_BtnActionPerformed
569 |
570 | private void id_TFKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_id_TFKeyTyped
571 | }//GEN-LAST:event_id_TFKeyTyped
572 |
573 | private void price_TFKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_price_TFKeyTyped
574 | char key = evt.getKeyChar();
575 | if(!(key >= '0' && key <= '9')){
576 | evt.consume();
577 | }
578 | }//GEN-LAST:event_price_TFKeyTyped
579 |
580 | private void priceSrch_TFKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_priceSrch_TFKeyTyped
581 | char key = evt.getKeyChar();
582 | if(!(key >= '0' && key <= '9')){
583 | evt.consume();
584 | }
585 | }//GEN-LAST:event_priceSrch_TFKeyTyped
586 |
587 | private void clear_BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clear_BtnActionPerformed
588 | clearTextFields();
589 | }//GEN-LAST:event_clear_BtnActionPerformed
590 |
591 | private void delete_BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delete_BtnActionPerformed
592 | deleteDevice();
593 | }//GEN-LAST:event_delete_BtnActionPerformed
594 |
595 | private void SortList_BtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SortList_BtnActionPerformed
596 | // TODO add your handling code here:
597 | sort_ArrayListObject();
598 | updateTable();
599 | }//GEN-LAST:event_SortList_BtnActionPerformed
600 |
601 | private void close_menuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_close_menuItemActionPerformed
602 | System.exit(0);
603 | }//GEN-LAST:event_close_menuItemActionPerformed
604 |
605 | private void importDB_MenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importDB_MenuItemActionPerformed
606 | importFromCSV();
607 | }//GEN-LAST:event_importDB_MenuItemActionPerformed
608 |
609 | private void category_CBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_category_CBActionPerformed
610 | }//GEN-LAST:event_category_CBActionPerformed
611 |
612 | private void categorySearch_CBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_categorySearch_CBActionPerformed
613 | // TODO add your handling code here:
614 | }//GEN-LAST:event_categorySearch_CBActionPerformed
615 |
616 | private void totalCategorySrch_CBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_totalCategorySrch_CBActionPerformed
617 | // TODO add your handling code here:
618 | }//GEN-LAST:event_totalCategorySrch_CBActionPerformed
619 |
620 | private void totalDeviceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_totalDeviceActionPerformed
621 | totalItemInCategory();
622 | }//GEN-LAST:event_totalDeviceActionPerformed
623 |
624 | private void openFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openFileActionPerformed
625 | // TODO add your handling code here:
626 | try{
627 | String path = System.getProperty("user.dir");
628 | Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+path+"\\rights_reserved.pdf");
629 | }catch(Exception e){
630 | JOptionPane.showMessageDialog(rootPane, "not found", "error", JOptionPane.ERROR_MESSAGE);
631 | }
632 | }//GEN-LAST:event_openFileActionPerformed
633 |
634 | private void UserManualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UserManualActionPerformed
635 | try{
636 | String path = System.getProperty("user.dir");
637 | Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+path+"\\usermanual.pdf");
638 | }catch(Exception e){
639 | JOptionPane.showMessageDialog(rootPane, "not found", "error", JOptionPane.ERROR_MESSAGE);
640 | }
641 | }//GEN-LAST:event_UserManualActionPerformed
642 | public void deleteDevice(){
643 | try{
644 | DefaultTableModel model = (DefaultTableModel) computerIS_Tbl.getModel();
645 |
646 | int deletionRow = computerIS_Tbl.getSelectedRow();
647 | String checkElement = computerIS_Tbl.getValueAt((deletionRow), 1).toString();
648 | if(deletionRow == -1){
649 | JOptionPane.showMessageDialog(rootPane,"Please select a row to delete","Error",JOptionPane.ERROR_MESSAGE);
650 | }else if(checkElement.equals("")){
651 | JOptionPane.showMessageDialog(rootPane,"An Empty row is selected","Error",JOptionPane.ERROR_MESSAGE);
652 | }else{
653 | list.remove(deletionRow);
654 | updateTable();
655 | loadToCSV();
656 | }
657 | }catch(NullPointerException no){
658 | JOptionPane.showMessageDialog(rootPane,"An Empty row is selected","Error",JOptionPane.ERROR_MESSAGE);
659 | }catch(ArrayIndexOutOfBoundsException aex){
660 | JOptionPane.showMessageDialog(rootPane,"Please select a row to delete","Error",JOptionPane.ERROR_MESSAGE);
661 | }
662 | }
663 | public void validation(String deviceID, String deviceName, String devicePrice,String deviceCategory, String deviceType){
664 | String [] table_Values = {deviceID, deviceName,deviceCategory,range,deviceType, devicePrice};
665 | if (deviceID.equals("") || deviceName.equals("") || devicePrice.equals("") ){
666 | JOptionPane.showMessageDialog(rootPane,"Fill the Form to add new device","Empty Form", JOptionPane.ERROR_MESSAGE);
667 | }else if(range_BtnGrp.getSelection()==null){
668 | JOptionPane.showMessageDialog(rootPane,"Select Device Range Level","Select Range", JOptionPane.ERROR_MESSAGE);
669 | }else{
670 | int nextRow = 0;
671 | boolean emptyRowCheck = false;
672 | int rowCount = computerIS_Tbl.getRowCount();
673 | int colCount = computerIS_Tbl.getColumnCount();
674 | String s;
675 | while (nextRow=10 && Integer.parseInt(devicePrice)<=1099){
693 | add_to_table_arraylist(nextRow, rowCount, table_Values, colCount, computerIS_Tbl,deviceID, deviceName,deviceCategory, range, deviceType, devicePrice);
694 | }else{
695 | JOptionPane.showMessageDialog(rootPane,"The Range for budget range device is in between $10-1099","Price Range Error", JOptionPane.ERROR_MESSAGE);
696 | }
697 | }else if(Mid_RangeBtn.isSelected()){
698 | if(Integer.parseInt(devicePrice)>=1100 && Integer.parseInt(devicePrice)<=1999){
699 | add_to_table_arraylist(nextRow, rowCount, table_Values, colCount, computerIS_Tbl,deviceID, deviceName,deviceCategory, range, deviceType, devicePrice);
700 | }else{
701 | JOptionPane.showMessageDialog(rootPane,"The Range for Mid range is in between $1100-1999","Price Range Error", JOptionPane.ERROR_MESSAGE);
702 | }
703 | }else if(High_rangeBtn.isSelected()){
704 | if(Integer.parseInt(devicePrice)>=2000 && Integer.parseInt(devicePrice)<=12000){
705 | add_to_table_arraylist(nextRow, rowCount, table_Values, colCount, computerIS_Tbl,deviceID, deviceName,deviceCategory, range, deviceType, devicePrice);
706 | }else{
707 | JOptionPane.showMessageDialog(rootPane,"The Range for High range is in between 2000-12000","Price Range Error", JOptionPane.ERROR_MESSAGE);
708 | }
709 | }
710 |
711 | }
712 | }
713 | }
714 | public void add_to_table_arraylist(int nextRow, int rowCount, String [] val , int colcount, JTable abc, String ID, String DN, String DC,String rg, String DT, String DP){
715 | if(nextRow categoryList = new ArrayList();
799 | for(TableRows s: list){
800 | if(s.getCategory().equals(searchCategory)){
801 | categoryList.add(s);
802 | }
803 | }
804 | int index = binary_Search(categoryList, 0, categoryList.size()-1, search_Value);
805 | if(index == -1){
806 | JOptionPane.showMessageDialog(rootPane,"Sorry, no items found according to your preference.","Not Found", JOptionPane.INFORMATION_MESSAGE);
807 | }else{
808 | String deviceID = categoryList.get(index).getID();
809 | String deviceName = categoryList.get(index).getName();
810 | String deviceCategory = categoryList.get(index).getCategory();
811 | String deviceRange = categoryList.get(index).getRange_Level();
812 | String deviceType = categoryList.get(index).getType();
813 | int devicePrice = categoryList.get(index).getPrice();
814 | JOptionPane.showMessageDialog(rootPane,"The Device of your choice\nDevice ID: "+deviceID+
815 | "\nDevice Name: "+deviceName+
816 | "\nDevice Category: "+deviceCategory+
817 | "\nDevice Range: "+deviceRange+
818 | "\nDevice Type: "+deviceType+
819 | "\nDevice Price: $"+devicePrice,
820 | "Device Info", JOptionPane.INFORMATION_MESSAGE); }}}}
821 |
822 |
823 | public int binary_Search(ArrayList anylist, int low, int high, int searchValue ){
824 | if(low<=high){
825 | int mid = (low+high)/2;
826 | if(anylist.get(mid).getPrice()==searchValue){
827 | return mid;
828 | } else if(anylist.get(mid).getPrice()>searchValue){
829 | return binary_Search(anylist,low,mid-1,searchValue);
830 | }else{
831 | return binary_Search(anylist,mid+1,high, searchValue);
832 | }
833 | }else{
834 | return -1;
835 | }
836 | }
837 |
838 | public void loadToCSV(){
839 | try{
840 | File CSVfile = new File("MallaComputers_database.CSV");
841 | if(!CSVfile.isFile()){
842 | CSVfile.createNewFile();
843 | }
844 | FileWriter fw = new FileWriter(CSVfile);
845 | for(TableRows tr: list){
846 | String device[] = {tr.getID(), tr.getName(), tr.getCategory() , tr.getRange_Level() , tr.getType() , Integer.toString(tr.getPrice())};
847 | for(int i=0; i
930 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
931 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
932 | */
933 | try {
934 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
935 | if ("Nimbus".equals(info.getName())) {
936 | javax.swing.UIManager.setLookAndFeel(info.getClassName());
937 | break;
938 | }
939 | }
940 | } catch (ClassNotFoundException ex) {
941 | java.util.logging.Logger.getLogger(AppliancesInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
942 | } catch (InstantiationException ex) {
943 | java.util.logging.Logger.getLogger(AppliancesInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
944 | } catch (IllegalAccessException ex) {
945 | java.util.logging.Logger.getLogger(AppliancesInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
946 | } catch (javax.swing.UnsupportedLookAndFeelException ex) {
947 | java.util.logging.Logger.getLogger(AppliancesInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
948 | }
949 | //
950 |
951 | /* Create and display the form */
952 | java.awt.EventQueue.invokeLater(new Runnable() {
953 | public void run() {
954 | new AppliancesInfo().setVisible(true);
955 | }
956 | });
957 | }
958 |
959 | // Variables declaration - do not modify//GEN-BEGIN:variables
960 | private javax.swing.JRadioButton Budget_rangeBTN;
961 | private javax.swing.JRadioButton High_rangeBtn;
962 | private javax.swing.JRadioButton Mid_RangeBtn;
963 | private javax.swing.JButton SortList_Btn;
964 | private javax.swing.JRadioButtonMenuItem UserManual;
965 | private javax.swing.JButton add_Btn;
966 | private javax.swing.JComboBox categorySearch_CB;
967 | private javax.swing.JComboBox category_CB;
968 | private javax.swing.JButton clear_Btn;
969 | private javax.swing.JMenuItem close_menuItem;
970 | private javax.swing.JTable computerIS_Tbl;
971 | private javax.swing.JButton delete_Btn;
972 | private javax.swing.JButton exit_Btn;
973 | private javax.swing.JTextField id_TF;
974 | private javax.swing.JMenuItem importDB_MenuItem;
975 | private javax.swing.JComboBox jComboBox1;
976 | private javax.swing.JLabel jLabel1;
977 | private javax.swing.JLabel jLabel2;
978 | private javax.swing.JLabel jLabel3;
979 | private javax.swing.JLabel jLabel4;
980 | private javax.swing.JLabel jLabel5;
981 | private javax.swing.JLabel jLabel6;
982 | private javax.swing.JLabel jLabel7;
983 | private javax.swing.JLabel jLabel8;
984 | private javax.swing.JLabel jLabel9;
985 | private javax.swing.JMenu jMenu1;
986 | private javax.swing.JMenu jMenu2;
987 | private javax.swing.JMenuBar jMenuBar1;
988 | private javax.swing.JPanel jPanel1;
989 | private javax.swing.JPanel jPanel2;
990 | private javax.swing.JScrollPane jScrollPane1;
991 | private javax.swing.JTextField name_TF;
992 | private javax.swing.JRadioButtonMenuItem openFile;
993 | private javax.swing.JButton priceSrch_Btn;
994 | private javax.swing.JTextField priceSrch_TF;
995 | private javax.swing.JTextField price_TF;
996 | private javax.swing.ButtonGroup range_BtnGrp;
997 | private javax.swing.JPanel table_Panel;
998 | private javax.swing.JComboBox totalCategorySrch_CB;
999 | private javax.swing.JButton totalDevice;
1000 | private javax.swing.JComboBox type_CB;
1001 | // End of variables declaration//GEN-END:variables
1002 | }
1003 |
--------------------------------------------------------------------------------
/src/AppliancesInfo/TableRows.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 AppliancesInfo;
7 |
8 | /**
9 | *
10 | * @author Aadesh
11 | */
12 | public class TableRows {
13 | private String ID;
14 | private String Name;
15 | private String Category;
16 | private String Range_Level;
17 | private String Type;
18 | private int Price;
19 |
20 | public TableRows(String ID, String Name, String Category, String Range_Level, String Type, String Price) {
21 | this.ID = ID;
22 | this.Name = Name;
23 | this.Category = Category;
24 | this.Range_Level = Range_Level;
25 | this.Type = Type;
26 | this.Price = Integer.parseInt(Price);
27 | }
28 |
29 | public String getID() {
30 | return ID;
31 | }
32 |
33 | public String getName() {
34 | return Name;
35 | }
36 |
37 | public String getCategory() {
38 | return Category;
39 | }
40 |
41 | public String getRange_Level() {
42 | return Range_Level;
43 | }
44 |
45 | public String getType() {
46 | return Type;
47 | }
48 |
49 | public int getPrice() {
50 | return Price;
51 | }
52 |
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/usermanual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mikasha0/Laptop-Inventory-System--Java-programming/32abcdfc6a83b0d6b2257e42cf5840908872893b/usermanual.pdf
--------------------------------------------------------------------------------