Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package motor.part; import java.awt.Image; import java.awt.Point; import java.io.File; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.table.DefaultTableModel; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PiePlot3D; import org.jfree.chart.plot.PlotOrientation; import org.jfree.data.category.DefaultCategoryDataset; import org.jfree.data.general.DefaultPieDataset; import org.jfree.data.general.PieDataset; import org.jfree.util.Rotation; /** * * @author MUNNA-17 */ public class MainPanel extends javax.swing.JPanel { /** * Creates new form MainPanel */ Connection conn; ResultSet reslt; Statement st1, st2; String Name_field; String ID_NO_field; private Store_Class My_Store; private Customer Present_Customer; public MainPanel() throws SQLException, ParseException, IOException { try { initComponents(); Banner_Panel.setVisible(true); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Edit_New.setVisible(false); Bill_Panel.setVisible(false); Get_Requirements_Panel.setVisible(false); Graph_Panel.setVisible(false); Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql", "root", ""); st1 = conn.createStatement(); st1.executeQuery("USE Motor_Registry"); DateFormat format = new SimpleDateFormat("dd-mm-yyyy"); Date startingDate = format.parse("10-12-2013"); My_Store = new Store_Class("MY_STORE", "MY_STORE , A-307 ,LBS Hall OF RESIDENCE , IIT KHARAGPUR ", "Admin", "user123", startingDate); st1 = conn.createStatement(); String SQLString = "Update Inventory SET Sold_Today = " + 0 + " ; "; System.out.print(SQLString); int nnnI = st1.executeUpdate(SQLString); ImageIcon ic = new ImageIcon( ImageIO.read(new File("./src/Icons/Logo.png")).getScaledInstance(415, 165, Image.SCALE_SMOOTH)); jLabel13.setIcon(ic); jLabel16.setIcon(ic); jLabel17.setIcon(ic); jLabel18.setIcon(ic); } catch (ClassNotFoundException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { Banner_Panel = new javax.swing.JPanel(); Login_Panel = new javax.swing.JPanel(); UserNameField = new javax.swing.JTextField(); PassWordField = new javax.swing.JPasswordField(); Username = new javax.swing.JLabel(); Password = new javax.swing.JLabel(); Submit = new javax.swing.JButton(); Clear = new javax.swing.JButton(); Invalid_Login = new javax.swing.JLabel(); jButton5 = new javax.swing.JButton(); Customer_Panel = new javax.swing.JPanel(); Left_Panel = new javax.swing.JPanel(); CartPanel = new javax.swing.JPanel(); Cartpane = new javax.swing.JScrollPane(); Cart = new javax.swing.JTable(); CheckOut = new javax.swing.JButton(); CommandPanel = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); Product_Field = new javax.swing.JTextField(); Type = new javax.swing.JCheckBox(); Product = new javax.swing.JCheckBox(); RE_QUERY = new javax.swing.JLabel(); Logo_Holder = new javax.swing.JPanel(); jLabel13 = new javax.swing.JLabel(); SalyutingPanel = new javax.swing.JPanel(); Name = new javax.swing.JLabel(); Customer_NO = new javax.swing.JLabel(); Welcome = new javax.swing.JLabel(); Edit_Details = new javax.swing.JButton(); Logout = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); Search_Display_Pane = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); Query_Table = new javax.swing.JTable(); Admin_Panel = new javax.swing.JPanel(); SalyutingPanel1 = new javax.swing.JPanel(); Name1 = new javax.swing.JLabel(); Customer_NO1 = new javax.swing.JLabel(); Welcome1 = new javax.swing.JLabel(); Edit_Details1 = new javax.swing.JButton(); Logout1 = new javax.swing.JLabel(); Admin_Functionality = new javax.swing.JTabbedPane(); user_validation = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jScrollPane5 = new javax.swing.JScrollPane(); User_Data_Table = new javax.swing.JTable(); Deleted_Message = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); Check_Sales = new javax.swing.JPanel(); jScrollPane4 = new javax.swing.JScrollPane(); Sales_Inventory_Displat_Table = new javax.swing.JTable(); jPanel1 = new javax.swing.JPanel(); jButton2 = new javax.swing.JButton(); get_requirements = new javax.swing.JButton(); Insert_Product = new javax.swing.JPanel(); Insert_Panel = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); TypeField = new javax.swing.JTextField(); Quantity_Field = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); Price_Field = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); jScrollPane3 = new javax.swing.JScrollPane(); Vendor_Address_Area = new javax.swing.JTextArea(); jLabel8 = new javax.swing.JLabel(); Name_Field = new javax.swing.JTextField(); Inserter = new javax.swing.JButton(); clear1 = new javax.swing.JButton(); Delete_Panel = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); ID_FIELD = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); Name_Field1 = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); TYPE_FIELD = new javax.swing.JTextField(); Deleter = new javax.swing.JButton(); clear2 = new javax.swing.JButton(); Data_Update_Panel = new javax.swing.JPanel(); jLabel11 = new javax.swing.JLabel(); TypeField1 = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); Name_Field2 = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); ID_FIELD1 = new javax.swing.JTextField(); Update_Selector = new javax.swing.JComboBox(); Update = new javax.swing.JTextField(); clear3 = new javax.swing.JButton(); Updater = new javax.swing.JButton(); Update_Error_Label = new javax.swing.JLabel(); Edit_New = new javax.swing.JPanel(); Salyutin_new = new javax.swing.JPanel(); Logo_panel = new javax.swing.JPanel(); jLabel16 = new javax.swing.JLabel(); edit_new_label = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); jLabel20 = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); Username2 = new javax.swing.JTextField(); PAssword2 = new javax.swing.JTextField(); retype_password = new javax.swing.JTextField(); Social_Security_NO = new javax.swing.JTextField(); jLabel25 = new javax.swing.JLabel(); Customer_No = new javax.swing.JTextField(); Name2 = new javax.swing.JTextField(); Telephone_No = new javax.swing.JTextField(); sfsd = new javax.swing.JScrollPane(); Address = new javax.swing.JTextArea(); Submit_Details = new javax.swing.JButton(); Clear_Details = new javax.swing.JButton(); Details_Error_panel = new javax.swing.JLabel(); Returner = new javax.swing.JButton(); Bill_Panel = new javax.swing.JPanel(); jPanel6 = new javax.swing.JPanel(); jLabel17 = new javax.swing.JLabel(); sal = new javax.swing.JLabel(); biller = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); Bill_Table = new javax.swing.JTable(); jButton3 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); Graph_Panel = new javax.swing.JPanel(); Get_Requirements_Panel = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); req_label = new javax.swing.JLabel(); jPanel7 = new javax.swing.JPanel(); jLabel18 = new javax.swing.JLabel(); jScrollPane6 = new javax.swing.JScrollPane(); Req_Table = new javax.swing.JTable(); Print = new javax.swing.JButton(); Back = new javax.swing.JButton(); setOpaque(false); setPreferredSize(new java.awt.Dimension(1400, 730)); setLayout(new java.awt.CardLayout()); Banner_Panel.setForeground(new java.awt.Color(255, 255, 255)); Banner_Panel.setOpaque(false); Banner_Panel.setPreferredSize(new java.awt.Dimension(1400, 730)); Login_Panel.setBackground(new java.awt.Color(204, 255, 255)); Login_Panel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); Login_Panel.setOpaque(false); Login_Panel.setPreferredSize(new java.awt.Dimension(400, 200)); UserNameField.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N UserNameField.setForeground(new java.awt.Color(153, 153, 255)); UserNameField.setBorder(javax.swing.BorderFactory.createEtchedBorder()); UserNameField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { UserNameFieldActionPerformed(evt); } }); PassWordField.setColumns(40); PassWordField.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N PassWordField.setForeground(new java.awt.Color(153, 153, 255)); PassWordField.setBorder(javax.swing.BorderFactory.createEtchedBorder()); PassWordField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { PassWordFieldActionPerformed(evt); } }); Username.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N Username.setForeground(new java.awt.Color(0, 0, 204)); Username.setText("User Name :"); Username.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); Password.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N Password.setForeground(new java.awt.Color(0, 0, 204)); Password.setText("PassWord :"); Password.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); Submit.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N Submit.setForeground(new java.awt.Color(0, 0, 153)); Submit.setText("Submit"); Submit.setBorderPainted(false); Submit.setOpaque(false); Submit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SubmitActionPerformed(evt); } }); Clear.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N Clear.setForeground(new java.awt.Color(0, 0, 153)); Clear.setText("Clear"); Clear.setOpaque(false); Clear.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ClearActionPerformed(evt); } }); Invalid_Login.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); jButton5.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N jButton5.setForeground(new java.awt.Color(0, 0, 153)); jButton5.setText("New Users Register Here"); jButton5.setOpaque(false); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); javax.swing.GroupLayout Login_PanelLayout = new javax.swing.GroupLayout(Login_Panel); Login_Panel.setLayout(Login_PanelLayout); Login_PanelLayout.setHorizontalGroup(Login_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Login_PanelLayout.createSequentialGroup().addGroup(Login_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Login_PanelLayout.createSequentialGroup().addContainerGap(26, Short.MAX_VALUE) .addComponent(Submit)) .addGroup(Login_PanelLayout.createSequentialGroup() .addComponent(Password, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addGap(18, 18, 18) .addGroup(Login_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(PassWordField, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(Login_PanelLayout.createSequentialGroup().addComponent(jButton5) .addGap(18, 18, 18).addComponent(Clear).addGap(13, 13, 13))) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Login_PanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(Invalid_Login, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(83, 83, 83)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Login_PanelLayout.createSequentialGroup() .addComponent(Username, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(UserNameField, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); Login_PanelLayout.setVerticalGroup(Login_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Login_PanelLayout.createSequentialGroup().addContainerGap() .addGroup(Login_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(UserNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Username)) .addGap(28, 28, 28) .addGroup(Login_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(PassWordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Password)) .addGap(46, 46, 46) .addComponent(Invalid_Login, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(Login_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Submit).addComponent(Clear).addComponent(jButton5)) .addContainerGap())); javax.swing.GroupLayout Banner_PanelLayout = new javax.swing.GroupLayout(Banner_Panel); Banner_Panel.setLayout(Banner_PanelLayout); Banner_PanelLayout.setHorizontalGroup(Banner_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Banner_PanelLayout.createSequentialGroup() .addContainerGap(994, Short.MAX_VALUE) .addComponent(Login_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29))); Banner_PanelLayout.setVerticalGroup(Banner_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Banner_PanelLayout.createSequentialGroup() .addComponent(Login_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 530, Short.MAX_VALUE))); add(Banner_Panel, "card2"); Customer_Panel.setPreferredSize(new java.awt.Dimension(1400, 730)); Left_Panel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); CartPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cart", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Monotype Corsiva", 2, 24), new java.awt.Color(0, 0, 255))); // NOI18N Cart.setAutoCreateRowSorter(true); Cart.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Cart.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null }, { null, null, null } }, new String[] { "ID", "Name", "Qnty" }) { Class[] types = new Class[] { java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class }; boolean[] canEdit = new boolean[] { false, false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); Cart.setEditingColumn(3); Cart.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { CartMouseReleased(evt); } }); Cartpane.setViewportView(Cart); CheckOut.setText("Check Out"); CheckOut.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CheckOutActionPerformed(evt); } }); javax.swing.GroupLayout CartPanelLayout = new javax.swing.GroupLayout(CartPanel); CartPanel.setLayout(CartPanelLayout); CartPanelLayout .setHorizontalGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CartPanelLayout.createSequentialGroup().addGap(42, 42, 42).addComponent(CheckOut) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CartPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Cartpane, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); CartPanelLayout.setVerticalGroup(CartPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CartPanelLayout.createSequentialGroup().addGap(0, 0, 0) .addComponent(Cartpane, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE) .addComponent(CheckOut).addContainerGap())); javax.swing.GroupLayout Left_PanelLayout = new javax.swing.GroupLayout(Left_Panel); Left_Panel.setLayout(Left_PanelLayout); Left_PanelLayout .setHorizontalGroup(Left_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(CartPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); Left_PanelLayout.setVerticalGroup(Left_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Left_PanelLayout.createSequentialGroup().addContainerGap() .addComponent(CartPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); CommandPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jButton1.setText("Search"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Search:"); jLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Product_Field.setText(" "); Product_Field.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Product_FieldActionPerformed(evt); } }); Type.setText("Product Type"); Product.setText("Product"); RE_QUERY.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N RE_QUERY.setForeground(new java.awt.Color(204, 0, 0)); RE_QUERY.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); RE_QUERY.setText("Please Re-enter Query"); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 43, Short.MAX_VALUE) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(Type, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(41, 41, 41) .addComponent(RE_QUERY, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Product, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(Product_Field, javax.swing.GroupLayout.PREFERRED_SIZE, 518, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 70, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addGap(35, 35, 35) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Product_Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)) .addGap(18, 18, 18) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Type).addComponent(Product).addComponent(RE_QUERY)) .addContainerGap(34, Short.MAX_VALUE))); Logo_Holder.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Logo_Holder.setPreferredSize(new java.awt.Dimension(400, 170)); jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel13.setBorder(javax.swing.BorderFactory.createEtchedBorder()); javax.swing.GroupLayout Logo_HolderLayout = new javax.swing.GroupLayout(Logo_Holder); Logo_Holder.setLayout(Logo_HolderLayout); Logo_HolderLayout .setHorizontalGroup(Logo_HolderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); Logo_HolderLayout .setVerticalGroup(Logo_HolderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)); javax.swing.GroupLayout CommandPanelLayout = new javax.swing.GroupLayout(CommandPanel); CommandPanel.setLayout(CommandPanelLayout); CommandPanelLayout.setHorizontalGroup(CommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CommandPanelLayout.createSequentialGroup().addContainerGap() .addComponent(Logo_Holder, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(42, 42, 42))); CommandPanelLayout.setVerticalGroup(CommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CommandPanelLayout.createSequentialGroup().addContainerGap().addGroup(CommandPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CommandPanelLayout.createSequentialGroup().addGap(12, 12, 12).addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(Logo_Holder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(20, Short.MAX_VALUE))); SalyutingPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Name.setForeground(new java.awt.Color(0, 0, 153)); Name.setText("Name:XXX"); Customer_NO.setForeground(new java.awt.Color(0, 0, 153)); Customer_NO.setText("Customer No:XXX"); Welcome.setForeground(new java.awt.Color(0, 0, 204)); Welcome.setText("Welcome :"); Edit_Details.setText("Edit Details"); Edit_Details.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Edit_DetailsActionPerformed(evt); } }); Logout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/Button_Logout.gif"))); // NOI18N Logout.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Logout.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { LogoutMouseReleased(evt); } }); jButton4.setText("View Previous Purchases"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); javax.swing.GroupLayout SalyutingPanelLayout = new javax.swing.GroupLayout(SalyutingPanel); SalyutingPanel.setLayout(SalyutingPanelLayout); SalyutingPanelLayout.setHorizontalGroup(SalyutingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SalyutingPanelLayout.createSequentialGroup().addGap(92, 92, 92).addComponent(Welcome) .addGap(18, 18, 18) .addComponent(Name, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(28, 28, 28).addComponent(Customer_NO) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 510, Short.MAX_VALUE) .addComponent(Edit_Details).addGap(69, 69, 69).addComponent(jButton4).addGap(75, 75, 75) .addComponent(Logout).addGap(21, 21, 21))); SalyutingPanelLayout.setVerticalGroup( SalyutingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SalyutingPanelLayout.createSequentialGroup() .addGroup(SalyutingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Name).addComponent(Customer_NO).addComponent(Welcome) .addComponent(Edit_Details).addComponent(jButton4)) .addGap(0, 17, Short.MAX_VALUE)) .addGroup(SalyutingPanelLayout.createSequentialGroup() .addComponent(Logout, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addContainerGap())); Query_Table.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Query_Table.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null }, { null, null, null, null, null, null, null } }, new String[] { "Part ID", "Part Type", "Part Name", "Price Per Unit", "Qty Available", "Vendor_Details", "Description" }) { Class[] types = new Class[] { java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class }; boolean[] canEdit = new boolean[] { false, false, false, false, false, false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); Query_Table.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Query_TableMouseClicked(evt); } }); jScrollPane1.setViewportView(Query_Table); javax.swing.GroupLayout Search_Display_PaneLayout = new javax.swing.GroupLayout(Search_Display_Pane); Search_Display_Pane.setLayout(Search_Display_PaneLayout); Search_Display_PaneLayout.setHorizontalGroup(Search_Display_PaneLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(Search_Display_PaneLayout .createSequentialGroup().addContainerGap().addComponent(jScrollPane1).addContainerGap())); Search_Display_PaneLayout.setVerticalGroup( Search_Display_PaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Search_Display_PaneLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 363, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(79, Short.MAX_VALUE))); javax.swing.GroupLayout Customer_PanelLayout = new javax.swing.GroupLayout(Customer_Panel); Customer_Panel.setLayout(Customer_PanelLayout); Customer_PanelLayout.setHorizontalGroup(Customer_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(SalyutingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(Customer_PanelLayout.createSequentialGroup().addContainerGap() .addGroup(Customer_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Customer_PanelLayout.createSequentialGroup() .addComponent(CommandPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(Customer_PanelLayout.createSequentialGroup() .addComponent(Left_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Search_Display_Pane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))); Customer_PanelLayout.setVerticalGroup(Customer_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Customer_PanelLayout.createSequentialGroup() .addComponent(SalyutingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(CommandPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( Customer_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Search_Display_Pane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(Customer_PanelLayout.createSequentialGroup() .addComponent(Left_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 55, Short.MAX_VALUE))) .addContainerGap())); add(Customer_Panel, "card3"); Admin_Panel.setPreferredSize(new java.awt.Dimension(1400, 730)); SalyutingPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Name1.setForeground(new java.awt.Color(0, 0, 153)); Name1.setText("Name:XXX"); Customer_NO1.setForeground(new java.awt.Color(0, 0, 153)); Customer_NO1.setText("Work Efficiently , Govern Gently"); Welcome1.setForeground(new java.awt.Color(0, 0, 204)); Welcome1.setText("Welcome :"); Edit_Details1.setText("Edit Details"); Edit_Details1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Edit_Details1ActionPerformed(evt); } }); Logout1.setText("Logout Picture"); Logout1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Logout1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { Logout1MouseReleased(evt); } }); javax.swing.GroupLayout SalyutingPanel1Layout = new javax.swing.GroupLayout(SalyutingPanel1); SalyutingPanel1.setLayout(SalyutingPanel1Layout); SalyutingPanel1Layout.setHorizontalGroup(SalyutingPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SalyutingPanel1Layout.createSequentialGroup().addGap(87, 87, 87).addComponent(Welcome1) .addGap(18, 18, 18) .addComponent(Name1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(28, 28, 28).addComponent(Customer_NO1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 780, Short.MAX_VALUE) .addComponent(Edit_Details1).addGap(116, 116, 116).addComponent(Logout1) .addGap(33, 33, 33))); SalyutingPanel1Layout.setVerticalGroup(SalyutingPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SalyutingPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(SalyutingPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(SalyutingPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Name1).addComponent(Customer_NO1).addComponent(Welcome1)) .addGroup(SalyutingPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Edit_Details1).addComponent(Logout1))))); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100, Short.MAX_VALUE)); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE)); User_Data_Table.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null } }, new String[] { "Customer ID", "Name", "Social Sec No", "Last Access", "Total Purchase" }) { Class[] types = new Class[] { java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class }; boolean[] canEdit = new boolean[] { false, true, false, false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); User_Data_Table.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { User_Data_TableMouseReleased(evt); } }); jScrollPane5.setViewportView(User_Data_Table); if (User_Data_Table.getColumnModel().getColumnCount() > 0) { User_Data_Table.getColumnModel().getColumn(4).setHeaderValue("Total Purchase"); } Deleted_Message.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N Deleted_Message.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); Deleted_Message.setText("Customer Is Deleted Succesfully"); jLabel2.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N jLabel2.setForeground(new java.awt.Color(0, 0, 153)); jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("To Delete User Double Click on the Row."); javax.swing.GroupLayout user_validationLayout = new javax.swing.GroupLayout(user_validation); user_validation.setLayout(user_validationLayout); user_validationLayout.setHorizontalGroup(user_validationLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(user_validationLayout.createSequentialGroup().addGap(488, 488, 488) .addComponent(Deleted_Message, javax.swing.GroupLayout.PREFERRED_SIZE, 323, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(357, 357, 357)) .addGroup(user_validationLayout.createSequentialGroup().addGroup(user_validationLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(user_validationLayout.createSequentialGroup().addContainerGap().addComponent( jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 1396, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(user_validationLayout.createSequentialGroup().addGap(389, 389, 389).addComponent( jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); user_validationLayout.setVerticalGroup(user_validationLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(user_validationLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 398, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 95, Short.MAX_VALUE) .addGroup(user_validationLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, user_validationLayout .createSequentialGroup() .addComponent(Deleted_Message, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(26, 26, 26)) .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))); Admin_Functionality.addTab("user_validation", user_validation); Sales_Inventory_Displat_Table.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null }, { null, null, null, null, null, null } }, new String[] { "Time Of Purchase", "Item_ID", "Item Name", "Quantity", "Amount", "Customer_ID" }) { boolean[] canEdit = new boolean[] { false, true, false, false, false, true }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane4.setViewportView(Sales_Inventory_Displat_Table); jButton2.setText("Check Sales"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); get_requirements.setText("Get Requirements "); get_requirements.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { get_requirementsActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(349, 349, 349).addComponent(jButton2) .addGap(280, 280, 280).addComponent(get_requirements) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(70, 70, 70) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2).addComponent(get_requirements)) .addContainerGap(58, Short.MAX_VALUE))); javax.swing.GroupLayout Check_SalesLayout = new javax.swing.GroupLayout(Check_Sales); Check_Sales.setLayout(Check_SalesLayout); Check_SalesLayout.setHorizontalGroup(Check_SalesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Check_SalesLayout.createSequentialGroup() .addGroup(Check_SalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Check_SalesLayout.createSequentialGroup().addContainerGap().addComponent( jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1486, Short.MAX_VALUE)) .addGroup(Check_SalesLayout.createSequentialGroup().addGap(24, 24, 24).addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap())); Check_SalesLayout.setVerticalGroup(Check_SalesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Check_SalesLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(220, Short.MAX_VALUE))); Admin_Functionality.addTab("Check Sales", Check_Sales); Insert_Panel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText("Type:"); jLabel4.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel5.setText("Quantity:"); jLabel5.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Quantity_Field.setText(" "); jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel6.setText("Price:"); jLabel6.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Price_Field.setText(" "); Price_Field.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Price_FieldActionPerformed(evt); } }); jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel7.setText("Vendor Details :"); jLabel7.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Vendor_Address_Area.setColumns(20); Vendor_Address_Area.setRows(5); jScrollPane3.setViewportView(Vendor_Address_Area); jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel8.setText("Name:"); jLabel8.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Name_Field.setText(" "); Inserter.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N Inserter.setText("Insert"); Inserter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { InserterActionPerformed(evt); } }); clear1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N clear1.setText("Clear"); clear1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clear1ActionPerformed(evt); } }); javax.swing.GroupLayout Insert_PanelLayout = new javax.swing.GroupLayout(Insert_Panel); Insert_Panel.setLayout(Insert_PanelLayout); Insert_PanelLayout.setHorizontalGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Insert_PanelLayout.createSequentialGroup().addContainerGap() .addGroup(Insert_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4).addComponent(jLabel8)) .addGap(48, 48, 48) .addGroup( Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(Name_Field, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE) .addComponent(TypeField)) .addGap(114, 114, 114) .addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(46, 46, 46) .addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(Price_Field, javax.swing.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE) .addComponent(Quantity_Field)) .addGap(83, 83, 83).addComponent(jLabel7).addGap(18, 18, 18) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Inserter, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(102, 102, 102).addComponent(clear1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(58, 58, 58))); Insert_PanelLayout.setVerticalGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Insert_PanelLayout.createSequentialGroup().addContainerGap().addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, Insert_PanelLayout .createSequentialGroup().addGap(27, 27, 27) .addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(clear1).addComponent(Inserter))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(Insert_PanelLayout.createSequentialGroup() .addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(TypeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Insert_PanelLayout.createSequentialGroup() .addGap(23, 23, 23) .addGroup(Insert_PanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8).addComponent(Name_Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(Insert_PanelLayout.createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel7)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Insert_PanelLayout .createSequentialGroup() .addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5).addComponent( Quantity_Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(23, 23, 23) .addGroup(Insert_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6).addComponent(Price_Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(22, 22, 22)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); Delete_Panel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel9.setText("Item ID:"); jLabel9.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel10.setText("Name:"); jLabel10.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Name_Field1.setText(" "); jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel12.setText("Type:"); jLabel12.setBorder(javax.swing.BorderFactory.createEtchedBorder()); TYPE_FIELD.setText(" "); TYPE_FIELD.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { TYPE_FIELDActionPerformed(evt); } }); Deleter.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N Deleter.setText("Delete"); Deleter.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { DeleterActionPerformed(evt); } }); clear2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N clear2.setText("Clear"); clear2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clear2ActionPerformed(evt); } }); javax.swing.GroupLayout Delete_PanelLayout = new javax.swing.GroupLayout(Delete_Panel); Delete_Panel.setLayout(Delete_PanelLayout); Delete_PanelLayout .setHorizontalGroup( Delete_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( Delete_PanelLayout.createSequentialGroup().addContainerGap() .addComponent(jLabel9).addGap(48, 48, 48) .addComponent(ID_FIELD, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jLabel10).addGap(48, 48, 48) .addComponent(Name_Field1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(47, 47, 47) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(65, 65, 65) .addComponent(TYPE_FIELD, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Deleter, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(95, 95, 95) .addComponent(clear2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(59, 59, 59))); Delete_PanelLayout.setVerticalGroup(Delete_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Delete_PanelLayout.createSequentialGroup().addContainerGap().addGroup(Delete_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Delete_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12).addComponent(TYPE_FIELD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Delete_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel10).addComponent(Name_Field1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Delete_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9) .addComponent(ID_FIELD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Delete_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Deleter).addComponent(clear2))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); Data_Update_Panel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel11.setText("Type:"); jLabel11.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel14.setText("Name:"); jLabel14.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Name_Field2.setText(" "); jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel15.setText("Item ID:"); jLabel15.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Update_Selector.setModel(new javax.swing.DefaultComboBoxModel( new String[] { "Select Field", "Quantity", "Price", "Vendor Details" })); Update_Selector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Update_SelectorActionPerformed(evt); } }); Update.setText(" "); clear3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N clear3.setText("Clear"); clear3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clear3ActionPerformed(evt); } }); Updater.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N Updater.setText("Update"); Updater.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { UpdaterActionPerformed(evt); } }); javax.swing.GroupLayout Data_Update_PanelLayout = new javax.swing.GroupLayout(Data_Update_Panel); Data_Update_Panel.setLayout(Data_Update_PanelLayout); Data_Update_PanelLayout.setHorizontalGroup(Data_Update_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Data_Update_PanelLayout.createSequentialGroup().addContainerGap().addComponent(jLabel11) .addGap(51, 51, 51) .addComponent(TypeField1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jLabel14).addGap(48, 48, 48) .addComponent(Name_Field2, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE) .addGap(18, 18, 18).addComponent(jLabel15).addGap(48, 48, 48) .addComponent(ID_FIELD1, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent(Update_Selector, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(Update, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(187, 187, 187) .addComponent(Updater, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(103, 103, 103).addComponent(clear3, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(56, 56, 56))); Data_Update_PanelLayout.setVerticalGroup( Data_Update_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Data_Update_PanelLayout.createSequentialGroup().addContainerGap() .addGroup(Data_Update_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Data_Update_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11) .addComponent(TypeField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel14) .addComponent(Name_Field2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel15) .addComponent(ID_FIELD1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Update_Selector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Update, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Data_Update_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(clear3).addComponent(Updater))) .addContainerGap(33, Short.MAX_VALUE))); Update_Error_Label.setFont(new java.awt.Font("Times New Roman", 3, 24)); // NOI18N Update_Error_Label.setForeground(new java.awt.Color(204, 0, 0)); Update_Error_Label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); Update_Error_Label.setText("Please Enter Valid Details"); javax.swing.GroupLayout Insert_ProductLayout = new javax.swing.GroupLayout(Insert_Product); Insert_Product.setLayout(Insert_ProductLayout); Insert_ProductLayout.setHorizontalGroup( Insert_ProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Insert_ProductLayout.createSequentialGroup().addContainerGap() .addGroup(Insert_ProductLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Insert_Panel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Delete_Panel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Data_Update_Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addGroup(Insert_ProductLayout.createSequentialGroup().addGap(356, 356, 356) .addComponent(Update_Error_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 439, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); Insert_ProductLayout.setVerticalGroup(Insert_ProductLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Insert_ProductLayout.createSequentialGroup().addContainerGap() .addComponent(Insert_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(Delete_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(Data_Update_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(74, 74, 74).addComponent(Update_Error_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(250, Short.MAX_VALUE))); Admin_Functionality.addTab("Update Inventory", Insert_Product); javax.swing.GroupLayout Admin_PanelLayout = new javax.swing.GroupLayout(Admin_Panel); Admin_Panel.setLayout(Admin_PanelLayout); Admin_PanelLayout .setHorizontalGroup(Admin_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Admin_PanelLayout.createSequentialGroup().addContainerGap().addComponent( Admin_Functionality, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addComponent(SalyutingPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); Admin_PanelLayout.setVerticalGroup(Admin_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Admin_PanelLayout.createSequentialGroup() .addComponent(SalyutingPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Admin_Functionality).addContainerGap())); add(Admin_Panel, "card4"); Salyutin_new.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Logo_panel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); Logo_panel.setPreferredSize(new java.awt.Dimension(420, 170)); jLabel16.setText(" "); jLabel16.setBorder(javax.swing.BorderFactory.createEtchedBorder()); javax.swing.GroupLayout Logo_panelLayout = new javax.swing.GroupLayout(Logo_panel); Logo_panel.setLayout(Logo_panelLayout); Logo_panelLayout .setHorizontalGroup(Logo_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Logo_panelLayout.createSequentialGroup() .addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE) .addGap(0, 5, Short.MAX_VALUE))); Logo_panelLayout .setVerticalGroup(Logo_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); edit_new_label.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N edit_new_label.setForeground(new java.awt.Color(0, 0, 153)); edit_new_label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); edit_new_label.setText("Label For Salyutation edit_details || New Customer"); javax.swing.GroupLayout Salyutin_newLayout = new javax.swing.GroupLayout(Salyutin_new); Salyutin_new.setLayout(Salyutin_newLayout); Salyutin_newLayout.setHorizontalGroup(Salyutin_newLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Salyutin_newLayout.createSequentialGroup().addContainerGap() .addComponent(Logo_panel, javax.swing.GroupLayout.PREFERRED_SIZE, 432, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(80, 80, 80).addComponent(edit_new_label, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(518, Short.MAX_VALUE))); Salyutin_newLayout .setVerticalGroup(Salyutin_newLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Salyutin_newLayout.createSequentialGroup().addContainerGap() .addComponent(Logo_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(Salyutin_newLayout.createSequentialGroup().addGap(39, 39, 39) .addComponent(edit_new_label, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(114, Short.MAX_VALUE))); jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel3.setText("UserName :"); jLabel19.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel19.setText("PassWord :"); jLabel20.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel20.setText("RE-Enter Password :"); jLabel21.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel21.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel21.setText("Social-Security-Number :"); jLabel22.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel22.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel22.setText("Customer No :"); jLabel23.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel23.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel23.setText("Name :"); jLabel24.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel24.setText("Telephone No :"); Username2.setText(" "); PAssword2.setText(" "); retype_password.setText(" "); Social_Security_NO.setText(" "); jLabel25.setText("Address :"); Customer_No.setText(" "); Name2.setText(" "); Telephone_No.setText(" "); Address.setColumns(20); Address.setRows(5); sfsd.setViewportView(Address); Submit_Details.setText("Submit"); Submit_Details.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Submit_DetailsActionPerformed(evt); } }); Clear_Details.setText("Clear"); Clear_Details.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Clear_DetailsActionPerformed(evt); } }); Details_Error_panel.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N Details_Error_panel.setForeground(new java.awt.Color(255, 0, 0)); Details_Error_panel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); Details_Error_panel.setText("Enter Valid _Details"); Details_Error_panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Returner.setText("Back"); Returner.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ReturnerActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(23, 23, 23).addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel20) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel22) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel24, javax.swing.GroupLayout.Alignment.TRAILING))) .addComponent(jLabel21) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel19).addComponent(jLabel3))) .addGap(132, 132, 132) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(Username2, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(PAssword2, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(retype_password, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Social_Security_NO, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Name2, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Telephone_No, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Customer_No, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Submit_Details)) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout .createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 596, Short.MAX_VALUE) .addComponent(jLabel25).addGap(114, 114, 114) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(Details_Error_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(sfsd, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)) .addGap(51, 51, 51)) .addGroup(jPanel2Layout.createSequentialGroup().addGap(248, 248, 248) .addComponent(Clear_Details) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Returner).addGap(71, 71, 71))))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(25, 25, 25).addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(sfsd, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createSequentialGroup().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(Username2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(21, 21, 21) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(PAssword2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel25).addComponent(jLabel19)) .addGap(22, 22, 22) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(retype_password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20)) .addGap(25, 25, 25) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Social_Security_NO, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel21)) .addGap(18, 18, 18) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Name2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel23).addComponent(Details_Error_panel))) .addGroup(jPanel2Layout .createSequentialGroup().addGap(2, 2, 2).addComponent(jLabel3))) .addGap(22, 22, 22) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(Telephone_No, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel2Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Customer_No, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel22))) .addComponent(jLabel24)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Submit_Details).addComponent(Clear_Details).addComponent(Returner)) .addGap(27, 27, 27))); javax.swing.GroupLayout Edit_NewLayout = new javax.swing.GroupLayout(Edit_New); Edit_New.setLayout(Edit_NewLayout); Edit_NewLayout.setHorizontalGroup(Edit_NewLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Edit_NewLayout.createSequentialGroup() .addContainerGap() .addGroup(Edit_NewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Salyutin_new, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); Edit_NewLayout.setVerticalGroup(Edit_NewLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Edit_NewLayout.createSequentialGroup().addContainerGap() .addComponent(Salyutin_new, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); add(Edit_New, "card5"); jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel6.setPreferredSize(new java.awt.Dimension(420, 170)); jLabel17.setText(" "); jLabel17.setBorder(javax.swing.BorderFactory.createEtchedBorder()); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE)); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)); sal.setFont(new java.awt.Font("Times New Roman", 3, 24)); // NOI18N sal.setForeground(new java.awt.Color(0, 0, 153)); sal.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); sal.setText("Thanks for choosing us "); sal.setBorder(javax.swing.BorderFactory.createEtchedBorder()); biller.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Invoice", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Monotype Corsiva", 3, 36), new java.awt.Color(0, 0, 153))); // NOI18N Bill_Table.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null } }, new String[] { "Product_Name", "type", "Quantity", "Per Unit", "Amount" }) { boolean[] canEdit = new boolean[] { false, false, false, false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane2.setViewportView(Bill_Table); javax.swing.GroupLayout billerLayout = new javax.swing.GroupLayout(biller); biller.setLayout(billerLayout); billerLayout.setHorizontalGroup(billerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, billerLayout.createSequentialGroup() .addContainerGap(20, Short.MAX_VALUE).addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 782, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); billerLayout.setVerticalGroup(billerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(billerLayout .createSequentialGroup().addContainerGap().addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 307, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(26, Short.MAX_VALUE))); jButton3.setText("Print Bill"); jButton6.setText("Exit"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); javax.swing.GroupLayout Bill_PanelLayout = new javax.swing.GroupLayout(Bill_Panel); Bill_Panel.setLayout(Bill_PanelLayout); Bill_PanelLayout.setHorizontalGroup(Bill_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Bill_PanelLayout.createSequentialGroup().addGroup(Bill_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Bill_PanelLayout.createSequentialGroup().addContainerGap() .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(38, 38, 38).addComponent(sal, javax.swing.GroupLayout.PREFERRED_SIZE, 459, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Bill_PanelLayout.createSequentialGroup().addGap(157, 157, 157).addComponent( biller, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Bill_PanelLayout.createSequentialGroup().addGap(249, 249, 249) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(231, 231, 231).addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(442, Short.MAX_VALUE))); Bill_PanelLayout.setVerticalGroup(Bill_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Bill_PanelLayout.createSequentialGroup().addGroup(Bill_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Bill_PanelLayout.createSequentialGroup().addContainerGap().addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Bill_PanelLayout.createSequentialGroup().addGap(53, 53, 53).addComponent(sal, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(biller, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(Bill_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton3).addComponent(jButton6)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); add(Bill_Panel, "card6"); Graph_Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Graph_PanelMouseClicked(evt); } }); javax.swing.GroupLayout Graph_PanelLayout = new javax.swing.GroupLayout(Graph_Panel); Graph_Panel.setLayout(Graph_PanelLayout); Graph_PanelLayout.setHorizontalGroup(Graph_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1423, Short.MAX_VALUE)); Graph_PanelLayout.setVerticalGroup(Graph_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 730, Short.MAX_VALUE)); add(Graph_Panel, "card7"); req_label.setFont(new java.awt.Font("Times New Roman", 3, 24)); // NOI18N req_label.setForeground(new java.awt.Color(0, 0, 153)); req_label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); req_label.setText("Requirements for : "); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap(56, Short.MAX_VALUE).addComponent(req_label, javax.swing.GroupLayout.PREFERRED_SIZE, 651, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(54, 54, 54))); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout .createSequentialGroup().addGap(27, 27, 27).addComponent(req_label, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(101, Short.MAX_VALUE))); jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel7.setPreferredSize(new java.awt.Dimension(420, 170)); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout .setHorizontalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addGap(165, 165, 165).addComponent(jLabel18) .addContainerGap(463, Short.MAX_VALUE))); jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel18).addGap(73, 73, 73))); Req_Table.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null } }, new String[] { "Part No :", "Part Type", "Number of parts", "Amount", "Vendor Details" })); jScrollPane6.setViewportView(Req_Table); Print.setText("Print out Requirements"); Print.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { PrintActionPerformed(evt); } }); Back.setText("Back"); Back.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { BackActionPerformed(evt); } }); javax.swing.GroupLayout Get_Requirements_PanelLayout = new javax.swing.GroupLayout(Get_Requirements_Panel); Get_Requirements_Panel.setLayout(Get_Requirements_PanelLayout); Get_Requirements_PanelLayout.setHorizontalGroup(Get_Requirements_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Get_Requirements_PanelLayout.createSequentialGroup().addContainerGap() .addGroup(Get_Requirements_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Get_Requirements_PanelLayout.createSequentialGroup().addGap(10, 10, 10) .addComponent(jScrollPane6)) .addGroup(Get_Requirements_PanelLayout.createSequentialGroup() .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, 632, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) .addGroup(Get_Requirements_PanelLayout.createSequentialGroup().addGap(168, 168, 168) .addComponent(Print) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Back).addGap(241, 241, 241))); Get_Requirements_PanelLayout.setVerticalGroup(Get_Requirements_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Get_Requirements_PanelLayout.createSequentialGroup().addContainerGap() .addGroup(Get_Requirements_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 356, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 131, Short.MAX_VALUE) .addGroup(Get_Requirements_PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(Print) .addComponent(Back)) .addGap(28, 28, 28))); add(Get_Requirements_Panel, "card8"); }// </editor-fold>//GEN-END:initComponents private void UserNameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UserNameFieldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_UserNameFieldActionPerformed private void PassWordFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PassWordFieldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_PassWordFieldActionPerformed private int getlogin() { try { //System.out.println( jComboBox1.getSelectedItem().getClass().getName()); String NameString = UserNameField.getText().trim(); String PASS_WORDString = (String.copyValueOf(PassWordField.getPassword())); st1 = conn.createStatement(); if (("".equals(NameString.trim())) || ("".equals(PASS_WORDString.trim()))) return -2; String Query_String = "SELECT * FROM Login_Details WHERE User_Name = '" + NameString.trim() + "' AND Password = '" + PASS_WORDString + "' ;"; reslt = st1.executeQuery(Query_String); //System.out.printf(Query_String); if (reslt.next()) { int tempI = Integer.parseInt(reslt.getString(8)); Present_Customer = new Customer(reslt.getString(1), tempI, reslt.getString(3), reslt.getString(2), reslt.getString(7), reslt.getString(6), reslt.getString(4)); return 1; } if (NameString.equalsIgnoreCase(My_Store.getAdmin_Username()) && PASS_WORDString.equalsIgnoreCase(My_Store.getAdmin_Password())) return 0; } catch (SQLException ex) { ex.printStackTrace(); } return -1; } private void SubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SubmitActionPerformed // TODO add your handling code here: int n = getlogin(); // System.out.print(n); Calendar c = new GregorianCalendar(); c.set(Calendar.HOUR_OF_DAY, 0); //anything 0 - 23 c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); Date dt = c.getTime(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String currentTime = sdf.format(dt); if (n == 0) { try { Banner_Panel.setVisible(false); Customer_Panel.setVisible(false); Admin_Panel.setVisible(true); Update_Error_Label.setVisible(false); Bill_Panel.setVisible(false); st1 = conn.createStatement(); reslt = st1.executeQuery("SELECT * FROM Login_Details ;"); Name1.setText("Name :" + My_Store.getAdmin_Username()); if (!reslt.next()) return; else { clear_table((DefaultTableModel) User_Data_Table.getModel()); fill_table3(reslt, (DefaultTableModel) User_Data_Table.getModel()); } st1 = conn.createStatement(); String SQLString; SQLString = "SELECT * FROM Sales_Registry WHERE Purchased_at = '" + currentTime + "' ;"; reslt = st1.executeQuery(SQLString); if (!reslt.next()) return; else { clear_table((DefaultTableModel) Sales_Inventory_Displat_Table.getModel()); fill_table21(reslt, 0, (DefaultTableModel) Sales_Inventory_Displat_Table.getModel()); } } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } } else if (n == 1) { try { Banner_Panel.setVisible(false); Customer_Panel.setVisible(true); RE_QUERY.setVisible(false); Admin_Panel.setVisible(false); Name.setText("Name : " + Present_Customer.getCustomer_Name()); Customer_NO.setText("Customer_NO : " + Present_Customer.getCustomer_ID()); st1 = conn.createStatement(); String SQLString; SQLString = "Update Login_Details SET Last_Access = '" + currentTime + "' WHERE Customer_ID = " + Present_Customer.getCustomer_ID() + ";"; int nI = st1.executeUpdate(SQLString); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } } else { System.out.print("invalid Login"); Invalid_Login.setText("Please Enter Valid Details"); } }//GEN-LAST:event_SubmitActionPerformed private void ClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ClearActionPerformed // TODO add your handling code here: UserNameField.setText(""); PassWordField.setText(""); Invalid_Login.setText(""); }//GEN-LAST:event_ClearActionPerformed private void CartMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CartMouseReleased // TODO add your handling code here: //Selected Is Set To Edit int row = Cart.rowAtPoint(evt.getPoint()); int col = Cart.columnAtPoint(evt.getPoint()); if (row >= 0 && col >= 0) { String s1String = "" + Cart.getValueAt(row, 0); String s2String = "" + Cart.getValueAt(row, 1); String s3String = "" + Cart.getValueAt(row, 2); //System.out.print(s1String +"adf" + s2String + "ffs" + s3String); Cart_Edit_Dialog dailo = new Cart_Edit_Dialog( (JFrame) this.getParent().getParent().getParent().getParent().getParent(), true, s1String, s2String, s3String); int value = Integer.parseInt(dailo.showDialog()); //System.out.print(value); ((DefaultTableModel) Cart.getModel()).removeRow(row); if (value == 0) { Present_Customer.MyCart.Remove_From_cart(Integer.parseInt(s1String)); } else { System.err.print(s1String); Present_Customer.MyCart.Edit_Cart(Integer.parseInt(s1String), value); ((DefaultTableModel) Cart.getModel()).insertRow(row, new Object[] { s1String, s2String, "" + value }); } } }//GEN-LAST:event_CartMouseReleased private void Product_FieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Product_FieldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_Product_FieldActionPerformed private void Price_FieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Price_FieldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_Price_FieldActionPerformed private void clear1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clear1ActionPerformed // TODO add your handling code here: Name_Field.setText(""); TYPE_FIELD.setText(""); Quantity_Field.setText(""); Price_Field.setText(""); Vendor_Address_Area.setText(""); }//GEN-LAST:event_clear1ActionPerformed private void TYPE_FIELDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TYPE_FIELDActionPerformed // TODO add your handling code here: }//GEN-LAST:event_TYPE_FIELDActionPerformed private void DeleterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleterActionPerformed try { // TODO add your handling code here: String ID_String = ID_FIELD.getText(); String NameString = Name_Field1.getText(); String TypeString = TYPE_FIELD.getText(); st1 = conn.createStatement(); String SQL_String; SQL_String = "DELETE FROM INVENTORY WHERE ID = " + ID_FIELD + "OR Name = " + NameString + ";"; int nI = st1.executeUpdate(SQL_String); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); Update_Error_Label.setVisible(true); } }//GEN-LAST:event_DeleterActionPerformed private void Update_SelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Update_SelectorActionPerformed // TODO add your handling code here: }//GEN-LAST:event_Update_SelectorActionPerformed private void clear3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clear3ActionPerformed // TODO add your handling code here: TypeField1.setText(";"); Name_Field2.setText(""); ID_FIELD1.setText(""); Update.setText(""); Update_Selector.setSelectedIndex(0); }//GEN-LAST:event_clear3ActionPerformed private void UpdaterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UpdaterActionPerformed try { // TODO add your handling code here: String TypeString = TypeField1.getText(); String NAmeString = Name_Field2.getName(); String IDString = ID_FIELD1.getText(); String updateString = Update.getText(); int update_value = Update_Selector.getSelectedIndex(); String updateString1String; String doop = " "; if (update_value == 1) { updateString1String = " Quantity "; } else if (update_value == 2) { updateString1String = " Price "; } else { updateString1String = " Vendor_Details "; doop = "'"; } String SQLString; SQLString = "Update Inventory SET " + updateString1String + " = " + doop + " " + updateString + " " + doop + " WHERE ID = " + IDString + ";"; int nI = st1.executeUpdate(SQLString); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_UpdaterActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed Banner_Panel.setVisible(false); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Graph_Panel.setVisible(true); DefaultCategoryDataset dataset = createDataset(); JFreeChart chart = createChart(dataset, "Last Month Sales"); // we put the chart into a panel ChartPanel chartPanel = new ChartPanel(chart); // default size chartPanel.setPreferredSize(new java.awt.Dimension(1300, 600)); // add it to our application chartPanel.setVisible(true); JPanel newpanel = new JPanel(); newpanel.setSize(1300, 700); newpanel.add(chartPanel); Graph_Panel.add(newpanel); }//GEN-LAST:event_jButton2ActionPerformed private DefaultCategoryDataset createDataset() { DefaultCategoryDataset objDataset = new DefaultCategoryDataset(); try { Calendar c = new GregorianCalendar(); c.set(Calendar.HOUR_OF_DAY, 0); //anything 0 - 23 c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); Date dt = c.getTime(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.text.SimpleDateFormat typ = new java.text.SimpleDateFormat("dd-mm-yyyy "); Calendar cal = Calendar.getInstance(); cal.setTime(dt); cal.add(Calendar.DATE, -30); //System.out.print(dt); Date dt1 = cal.getTime(); //System.out.print(dt1); String datesString; int Quantity; double Amount; for (int i = 0; i < 30; i++) { Quantity = 0; Amount = 0; Calendar cal1 = Calendar.getInstance(); cal.setTime(dt1); cal.add(Calendar.DATE, 1 * i); Date dt2 = cal.getTime(); String currentTime = sdf.format(dt2); st1 = conn.createStatement(); String SQLString; SQLString = "SELECT * FROM Sales_Registry WHERE Purchased_at = '" + currentTime + "' ;"; //System.out.print(SQLString); reslt = st1.executeQuery(SQLString); if (!reslt.next()) continue; else { do { Quantity += Integer.parseInt(reslt.getString(2)); Amount += Double.parseDouble(reslt.getString(3)); } while (reslt.next()); } datesString = typ.format(dt2); // objDataset.setValue(Quantity,"Quantity",datesString); objDataset.setValue((int) Amount, "Amount", datesString); } } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } return objDataset; } /** * Creates a chart */ private JFreeChart createChart(DefaultCategoryDataset dataset, String title) { JFreeChart objChart = ChartFactory.createBarChart("Monthly Sales Report", //Chart title "...Last Month...", //Domain axis label "Sales Amount (in INR)", //Range axis label dataset, //Chart Data PlotOrientation.VERTICAL, // orientation true, // include legend? true, // include tooltips? false // include URLs? ); return objChart; } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: //search code goes here if (Type.isSelected()) { try { st1 = conn.createStatement(); reslt = st1.executeQuery( "SELECT * FROM Inventory WHERE Type = '" + Product_Field.getText().trim() + "' ;"); if (!reslt.next()) RE_QUERY.setVisible(true); else { RE_QUERY.setVisible(false); clear_table((DefaultTableModel) Query_Table.getModel()); fill_table2(reslt, 0, (DefaultTableModel) Query_Table.getModel()); } } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } } else { try { st2 = conn.createStatement(); reslt = st2.executeQuery( "SELECT * FROM Inventory WHERE Name = '" + Product_Field.getText().trim() + "' ;"); if (!reslt.next()) RE_QUERY.setVisible(true); else { clear_table((DefaultTableModel) Query_Table.getModel()); fill_table2(reslt, 0, (DefaultTableModel) Query_Table.getModel()); } } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } } }//GEN-LAST:event_jButton1ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed // TODO add your handling code here: //view previous purchases code goes here Previously Previous_Purchases; Previous_Purchases = new Previously((JFrame) this.getParent().getParent().getParent().getParent(), true, Present_Customer.getCustomer_ID()); { Previous_Purchases.setVisible(true); } }//GEN-LAST:event_jButton4ActionPerformed private void Edit_DetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Edit_DetailsActionPerformed // TODO add your handling code here: Details_Error_panel.setVisible(false); Banner_Panel.setVisible(false); Edit_New.setVisible(true); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); edit_new_label.setText("Edit User Details"); Customer_No.setVisible(false); Username2.setEditable(false); Customer_No.setVisible(true); Customer_No.setEditable(false); jLabel22.setVisible(true); Username2.setText(Present_Customer.getUsername()); Name2.setText(Present_Customer.getCustomer_Name()); Customer_No.setText("" + Present_Customer.getCustomer_ID()); Address.setText(Present_Customer.getAddress()); Social_Security_NO.setText(Present_Customer.getSS_NO()); Telephone_No.setText(Present_Customer.getTelephone_No()); }//GEN-LAST:event_Edit_DetailsActionPerformed private void LogoutMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_LogoutMouseReleased // TODO add your handling code here: //Logout code goes here Banner_Panel.setVisible(true); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); UserNameField.setText(""); PassWordField.setText(""); }//GEN-LAST:event_LogoutMouseReleased private void Submit_DetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Submit_DetailsActionPerformed // TODO add your handling code here: Details_Error_panel.setVisible(true); if (edit_new_label.getText().equalsIgnoreCase("Edit User Details")) { if (!PAssword2.getText().equals(retype_password.getText())) Details_Error_panel.setText("Passwords Donot Match"); else { try { String UsernameString = Username2.getText().toString(); String NameString = Name2.getText().trim(); String AddressString = Address.getText(); String SS_NO = Social_Security_NO.getText(); Calendar c = new GregorianCalendar(); c.set(Calendar.HOUR_OF_DAY, 0); //anything 0 - 23 c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); Date dt = c.getTime(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String currentTime = sdf.format(dt); //String Date_String = c.getTime().toString() ; // System.out.print(currentTime); st1 = conn.createStatement(); String SQLString; SQLString = "Update Login_Details SET Name = '" + NameString + "' , Telno = " + Telephone_No.getText().toString() + " , Address = '" + AddressString + "' , Social_Security_NO = '" + SS_NO + "' , Last_Access = '" + currentTime + "' WHERE Customer_ID = " + Present_Customer.getCustomer_ID() + ";"; System.out.print(SQLString); int nI = st1.executeUpdate(SQLString); Details_Error_panel.setVisible(false); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (NumberFormatException nex) { Details_Error_panel.setText("Invalid Telephone Number"); } } } else { if (!PAssword2.getText().equals(retype_password.getText())) Details_Error_panel.setText("Passwords Donot Match"); else { try { String UsernameString = Username2.getText().toString(); String PasswordString = PAssword2.getText().toString(); String NameString = Name2.getText().trim(); String AddressString = Address.getText(); String SS_NO = Social_Security_NO.getText(); st1 = conn.createStatement(); Calendar c = new GregorianCalendar(); c.set(Calendar.HOUR_OF_DAY, 0); //anything 0 - 23 c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); Date dt = c.getTime(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String currentTime = sdf.format(dt); reslt = st1.executeQuery("SELECT COUNT(*) FROM Login_Details ;"); reslt.next(); int row_num = Integer.parseInt(reslt.getString(1)) + 1; st1 = conn.createStatement(); String SQLString; SQLString = "INSERT INTO Login_Details" + " VALUES ( '" + NameString + "' , " + Telephone_No.getText().toString() + " , '" + AddressString + "' , '" + SS_NO + "' , '" + currentTime + " ' , '" + UsernameString + "' , '" + PasswordString + "' ," + row_num + " );"; //System.out.print(SQLString); int nI = st1.executeUpdate(SQLString); } catch (SQLException ex) { ex.printStackTrace(); } catch (NumberFormatException nex) { Details_Error_panel.setText("Invalid Telephone Number"); } } } }//GEN-LAST:event_Submit_DetailsActionPerformed private void Clear_DetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Clear_DetailsActionPerformed // TODO add your handling code here: Username2.setText(""); PAssword2.setText(""); retype_password.setText(""); Social_Security_NO.setText(""); Name2.setText(""); Telephone_No.setText(""); Address.setText(""); }//GEN-LAST:event_Clear_DetailsActionPerformed private void Query_TableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Query_TableMouseClicked // TODO add your handling code here: Point p = evt.getPoint(); int row = Query_Table.rowAtPoint(p); int column = Query_Table.columnAtPoint(p); if (evt.getClickCount() == 2) { int product_id = Integer.parseInt((String) Query_Table.getValueAt(row, column)); Present_Customer.MyCart.Add_to_Cart(product_id); int index = Present_Customer.MyCart.getNo_of_Products(); update_Cart_Table(Present_Customer.MyCart.getSelected_Products()[index - 1], Cart.getRowCount(), (DefaultTableModel) Cart.getModel()); } }//GEN-LAST:event_Query_TableMouseClicked private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed // TODO add your handling code here: Banner_Panel.setVisible(false); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Edit_New.setVisible(true); edit_new_label.setText("New User Registration"); Customer_No.setVisible(false); jLabel22.setVisible(false); }//GEN-LAST:event_jButton5ActionPerformed private void ReturnerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ReturnerActionPerformed // TODO add your handling code here: if (!edit_new_label.getText().equalsIgnoreCase("Edit User Details")) { Banner_Panel.setVisible(true); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Edit_New.setVisible(false); } else { Banner_Panel.setVisible(false); Customer_Panel.setVisible(true); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Edit_New.setVisible(false); } }//GEN-LAST:event_ReturnerActionPerformed private void CheckOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckOutActionPerformed Banner_Panel.setVisible(false); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Edit_New.setVisible(false); Bill_Panel.setVisible(true); Calendar c = new GregorianCalendar(); c.set(Calendar.HOUR_OF_DAY, 0); //anything 0 - 23 c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); Date dt = c.getTime(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String currentTime = sdf.format(dt); double amount = 0.00; for (int i = 0; i < Present_Customer.MyCart.getNo_of_Products(); i++) { Product_Class p = Present_Customer.MyCart.getSelected_Products()[i]; try { // TODO add your handling code here: //update sales registry.generate bill... // st1 = conn.createStatement(); // reslt = st1.executeQuery("SELECT COUNT(*) FROM Login_Details ;"); // reslt.next(); // int row_num = Integer.parseInt(reslt.getString(1)) + 1; st1 = conn.createStatement(); String SQLString; SQLString = "INSERT INTO Sales_Registry VALUES ( '" + currentTime + "' , " + p.getType_ID() + ", " + p.getQuantity() + " , " + p.getQuantity() * p.getPrice() + " , " + Present_Customer.getCustomer_ID() + " );"; // System.out.print(SQLString); int nI = st1.executeUpdate(SQLString); double presentamount; presentamount = p.getQuantity() * p.getPrice(); amount += presentamount; ((DefaultTableModel) Bill_Table.getModel()).insertRow(i, new Object[] { p.getNameString(), p.getTypeString(), p.getQuantity(), p.getPrice(), presentamount }); st1 = conn.createStatement(); String sf = "SELECT * FROM Inventory WHERE ID = " + p.getType_ID() + " ;"; reslt = st1.executeQuery(sf); if (!reslt.next()) return; int up = Integer.parseInt(reslt.getString(3)) - p.getQuantity(); int down = p.getQuantity(); //System.out.print(up); // if(up <= 0) // SQLString = "DELETE FROM Inventory WHERE ID = " +p.getType_ID()+" ; "; // else{ SQLString = "Update Inventory SET Quantity = " + up + " WHERE ID = " + p.getType_ID() + " ; "; // } st1 = conn.createStatement(); int nnI = st1.executeUpdate(SQLString); st1 = conn.createStatement(); SQLString = "Update Inventory SET Sold_Today = " + down + " WHERE ID = " + p.getType_ID() + " ; "; System.out.print(SQLString); //int nnnI= st1.executeUpdate(SQLString); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } } ((DefaultTableModel) Bill_Table.getModel()).insertRow(Present_Customer.MyCart.getNo_of_Products(), new Object[] { "Total : ", "", "", "", amount }); sal.setText(sal.getText() + Present_Customer.getCustomer_Name() + " ."); }//GEN-LAST:event_CheckOutActionPerformed private void User_Data_TableMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_User_Data_TableMouseReleased // TODO add your handling code here: Point p = evt.getPoint(); int row = User_Data_Table.rowAtPoint(p); int column = User_Data_Table.columnAtPoint(p); if (evt.getClickCount() == 2) { try { String Customer_idI = (String) User_Data_Table.getValueAt(row, 0); st1 = conn.createStatement(); String SQL_String; SQL_String = "DELETE FROM Login_Details WHERE Customer_ID = " + Customer_idI + " ; "; int i = st1.executeUpdate(SQL_String); ((DefaultTableModel) User_Data_Table.getModel()).removeRow(row); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } } }//GEN-LAST:event_User_Data_TableMouseReleased private void InserterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InserterActionPerformed try { String Item_Name = Name_Field.getText(); String Item_Type = TypeField.getText(); String QuantityString = Quantity_Field.getText(); String PriceString = Price_Field.getText(); String Vendor_Address = Vendor_Address_Area.getText(); st1 = conn.createStatement(); reslt = st1.executeQuery("SELECT COUNT(*) FROM Inventory ;"); reslt.next(); int row_num = Integer.parseInt(reslt.getString(1)) + 1; st1 = conn.createStatement(); String SQL_String = "INSERT INTO Inventory VALUES ( " + row_num + " , '" + Item_Type + "' , " + QuantityString + " , " + PriceString + " , " + 0.00 + " , " + 0 + " , '" + Vendor_Address + "' , '" + Item_Name + "' );"; // System.out.print(SQL_String); int nI = st1.executeUpdate(SQL_String); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); Update_Error_Label.setVisible(true); } }//GEN-LAST:event_InserterActionPerformed private void clear2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clear2ActionPerformed // TODO add your handling code here: ID_FIELD.setText(""); Name_Field1.setText(""); TYPE_FIELD.setText(""); }//GEN-LAST:event_clear2ActionPerformed private void Edit_Details1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Edit_Details1ActionPerformed // TODO add your handling code here: Admin_Details_Edit details = new Admin_Details_Edit( (JFrame) this.getParent().getParent().getParent().getParent(), true, My_Store.getAdmin_Username(), My_Store.getAdmin_Password(), "M.S.Reddy"); details.setVisible(true); String[] data; data = (details.Show_Dialog()).split("#"); My_Store.setAddress(data[0]); My_Store.setAdmin_Username(data[0]); My_Store.setAdmin_Password(data[1]); System.out.print(data[0] + "1" + data[1] + "2" + data[2]); }//GEN-LAST:event_Edit_Details1ActionPerformed private void Logout1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Logout1MouseReleased // TODO add your handling code here: Banner_Panel.setVisible(true); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); UserNameField.setText(""); PassWordField.setText(""); }//GEN-LAST:event_Logout1MouseReleased private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed // TODO add your handling code here: Banner_Panel.setVisible(true); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Bill_Panel.setVisible(false); UserNameField.setText(""); PassWordField.setText(""); }//GEN-LAST:event_jButton6ActionPerformed private void get_requirementsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_get_requirementsActionPerformed Banner_Panel.setVisible(false); Customer_Panel.setVisible(false); Admin_Panel.setVisible(false); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Bill_Panel.setVisible(false); Get_Requirements_Panel.setVisible(true); try { // TODO add your handling code here: //threshold and print. java.text.SimpleDateFormat typ = new java.text.SimpleDateFormat("dd-mm-yyyy "); Calendar c = new GregorianCalendar(); c.set(Calendar.HOUR_OF_DAY, 0); //anything 0 - 23 c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); Date dt, dt1, dt2; dt = c.getTime(); Calendar cal = Calendar.getInstance(); cal.setTime(dt); cal.add(Calendar.DATE, 1); dt1 = cal.getTime(); Calendar cal1 = Calendar.getInstance(); cal.setTime(dt); cal.add(Calendar.DATE, 7); dt2 = cal.getTime(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); req_label.setText(req_label.getText() + typ.format(dt1) + " -- " + typ.format(dt2)); String currentTime = sdf.format(dt); st1 = conn.createStatement(); String SQL_String; SQL_String = "SELECT * FROM Inventory WHERE Sold_Today != " + 0 + " ;"; reslt = st1.executeQuery(SQL_String); System.out.print(SQL_String); if (!reslt.next()) return; int row = 0; do { double Threshold_Value = Double.parseDouble(reslt.getString(5)); int sold_Today = Integer.parseInt(reslt.getString(6)); int tempI = Integer.parseInt(reslt.getString(1)); int quant = Integer.parseInt(reslt.getString(3)); DateFormat format = new SimpleDateFormat("dd-mm-yyyy"); Date tempdate = format.parse(format.format(dt)); Threshold_Value = Product_Class.Calc_Threshold(Threshold_Value, sold_Today, My_Store.getStarting_Date(), dt); if (quant > Threshold_Value) continue; int tempi = (int) (Threshold_Value * 7); st1 = conn.createStatement(); SQL_String = "Update Inventory SET Threshold_Value = " + Threshold_Value + " WHERE ID = " + tempI + " ; "; System.out.print(SQL_String); int nnnI = st1.executeUpdate(SQL_String); ((DefaultTableModel) Req_Table.getModel()).insertRow(row, new Object[] { reslt.getString(1), reslt.getString(2), tempi, tempi * Double.parseDouble(reslt.getString(4)), reslt.getString(7) }); row++; } while (reslt.next()); } catch (SQLException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } catch (ParseException ex) { Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_get_requirementsActionPerformed private void PrintActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PrintActionPerformed // TODO add your handling code here: }//GEN-LAST:event_PrintActionPerformed private void BackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BackActionPerformed // TODO add your handling code here: Banner_Panel.setVisible(false); Customer_Panel.setVisible(false); Admin_Panel.setVisible(true); Update_Error_Label.setVisible(false); }//GEN-LAST:event_BackActionPerformed private void Graph_PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Graph_PanelMouseClicked // TODO add your handling code here: Point p = evt.getPoint(); if (evt.getClickCount() == 2) { Banner_Panel.setVisible(false); Customer_Panel.setVisible(false); Admin_Panel.setVisible(true); Deleted_Message.setVisible(false); Details_Error_panel.setVisible(false); Graph_Panel.setVisible(false); } }//GEN-LAST:event_Graph_PanelMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextArea Address; private javax.swing.JTabbedPane Admin_Functionality; private javax.swing.JPanel Admin_Panel; private javax.swing.JButton Back; private javax.swing.JPanel Banner_Panel; private javax.swing.JPanel Bill_Panel; private javax.swing.JTable Bill_Table; private javax.swing.JTable Cart; private javax.swing.JPanel CartPanel; private javax.swing.JScrollPane Cartpane; private javax.swing.JButton CheckOut; private javax.swing.JPanel Check_Sales; private javax.swing.JButton Clear; private javax.swing.JButton Clear_Details; private javax.swing.JPanel CommandPanel; private javax.swing.JLabel Customer_NO; private javax.swing.JLabel Customer_NO1; private javax.swing.JTextField Customer_No; private javax.swing.JPanel Customer_Panel; private javax.swing.JPanel Data_Update_Panel; private javax.swing.JPanel Delete_Panel; private javax.swing.JLabel Deleted_Message; private javax.swing.JButton Deleter; private javax.swing.JLabel Details_Error_panel; private javax.swing.JButton Edit_Details; private javax.swing.JButton Edit_Details1; private javax.swing.JPanel Edit_New; private javax.swing.JPanel Get_Requirements_Panel; private javax.swing.JPanel Graph_Panel; private javax.swing.JTextField ID_FIELD; private javax.swing.JTextField ID_FIELD1; private javax.swing.JPanel Insert_Panel; private javax.swing.JPanel Insert_Product; private javax.swing.JButton Inserter; private javax.swing.JLabel Invalid_Login; private javax.swing.JPanel Left_Panel; private javax.swing.JPanel Login_Panel; private javax.swing.JPanel Logo_Holder; private javax.swing.JPanel Logo_panel; private javax.swing.JLabel Logout; private javax.swing.JLabel Logout1; private javax.swing.JLabel Name; private javax.swing.JLabel Name1; private javax.swing.JTextField Name2; private javax.swing.JTextField Name_Field; private javax.swing.JTextField Name_Field1; private javax.swing.JTextField Name_Field2; private javax.swing.JTextField PAssword2; private javax.swing.JPasswordField PassWordField; private javax.swing.JLabel Password; private javax.swing.JTextField Price_Field; private javax.swing.JButton Print; private javax.swing.JCheckBox Product; private javax.swing.JTextField Product_Field; private javax.swing.JTextField Quantity_Field; private javax.swing.JTable Query_Table; private javax.swing.JLabel RE_QUERY; private javax.swing.JTable Req_Table; private javax.swing.JButton Returner; private javax.swing.JTable Sales_Inventory_Displat_Table; private javax.swing.JPanel Salyutin_new; private javax.swing.JPanel SalyutingPanel; private javax.swing.JPanel SalyutingPanel1; private javax.swing.JPanel Search_Display_Pane; private javax.swing.JTextField Social_Security_NO; private javax.swing.JButton Submit; private javax.swing.JButton Submit_Details; private javax.swing.JTextField TYPE_FIELD; private javax.swing.JTextField Telephone_No; private javax.swing.JCheckBox Type; private javax.swing.JTextField TypeField; private javax.swing.JTextField TypeField1; private javax.swing.JTextField Update; private javax.swing.JLabel Update_Error_Label; private javax.swing.JComboBox Update_Selector; private javax.swing.JButton Updater; private javax.swing.JTextField UserNameField; private javax.swing.JTable User_Data_Table; private javax.swing.JLabel Username; private javax.swing.JTextField Username2; private javax.swing.JTextArea Vendor_Address_Area; private javax.swing.JLabel Welcome; private javax.swing.JLabel Welcome1; private javax.swing.JPanel biller; private javax.swing.JButton clear1; private javax.swing.JButton clear2; private javax.swing.JButton clear3; private javax.swing.JLabel edit_new_label; private javax.swing.JButton get_requirements; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JPanel jPanel7; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JScrollPane jScrollPane5; private javax.swing.JScrollPane jScrollPane6; private javax.swing.JLabel req_label; private javax.swing.JTextField retype_password; private javax.swing.JLabel sal; private javax.swing.JScrollPane sfsd; private javax.swing.JPanel user_validation; // End of variables declaration//GEN-END:variables private void clear_table(DefaultTableModel model) { model.setRowCount(0); } private void fill_table2(ResultSet rs, int row, DefaultTableModel model) throws SQLException { int present_row = row; do { String n1 = rs.getString(1); String n2 = rs.getString(2); String n3 = rs.getString(3); String n4 = rs.getString(4); String n7 = rs.getString(7); String n8 = rs.getString(8); //Object[][]data={{n,e}}; // This will add row from the DB as the last row in the JTable. model.insertRow(present_row, new Object[] { n1, n2, n8, n4, n3, n7 }); present_row++; } while (rs.next()); } private void fill_table21(ResultSet rs, int row, DefaultTableModel model) throws SQLException { int present_row = row; double total = 0; int quantity = 0; do { String n1 = rs.getString(1); String n2 = rs.getString(2); String n3 = rs.getString(3); String n4 = rs.getString(4); String n5 = rs.getString(5); total += Double.parseDouble(n4); quantity += Integer.parseInt(n3); String name = ""; st1 = conn.createStatement(); reslt = st1.executeQuery( "SELECT * FROM Inventory WHERE Type = '" + Product_Field.getText().trim() + "' ;"); if (reslt.next()) name = reslt.getString(2); model.insertRow(present_row, new Object[] { n1, n2, name, n3, n4, n5 }); present_row++; } while (rs.next()); model.insertRow(present_row, new Object[] { "Quantity Total :", quantity, "", "", "Total :", total }); } private void fill_table3(ResultSet rs, DefaultTableModel model) throws SQLException { int present_row = 0; do { String n1 = rs.getString(1); String n2 = rs.getString(2); String n3 = rs.getString(3); String n4 = rs.getString(4); String n5 = rs.getString(5); String n8 = rs.getString(8); //Object[][]data={{n,e}}; // This will add row from the DB as the last row in the JTable. model.insertRow(present_row, new Object[] { n8, n1, n4, n5 }); present_row++; } while (rs.next()); } private void update_Cart_Table(Product_Class p, int rowI, DefaultTableModel t_model) { t_model.insertRow(rowI, new Object[] { p.getType_ID(), p.getNameString(), p.getQuantity() }); } }