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 ecorecyclesimulator; import java.awt.BorderLayout; import java.awt.event.KeyEvent; import java.sql.Array; import java.util.Date; import java.sql.SQLException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Random; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTable; import org.jfree.chart.ChartFrame; import org.jfree.data.general.DefaultPieDataset; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PiePlot; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartFrame; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PiePlot; import org.jfree.chart.plot.PiePlot3D; import org.jfree.data.general.DefaultPieDataset; /** * * @author Nathan */ public class RmosGUI extends javax.swing.JFrame { /** * Creates new form RmosGUI */ // private static final String PASSWORD_PATTERN = "((?=.*[a-z])(?=.*\\d)(?=.*[A-Z])(?=.*[@#$%!]).{6,15})"; int price = 0; int weight = 0; Rcm rcmGuiObj; DbConnect dbconn; JCheckBox[] ar; public RmosGUI() { initComponents(); showHideNavigationPanelButtons(false); exitAdminButton.setEnabled(false); } /** * 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() { jLabel1 = new javax.swing.JLabel(); mainFramePanel = new javax.swing.JPanel(); leftPanel = new javax.swing.JPanel(); leftUpperPanel = new javax.swing.JPanel(); iconLabel = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); leftLowerPanel = new javax.swing.JPanel(); rcmButtonPanel = new javax.swing.JPanel(); btnAddRCM = new javax.swing.JButton(); btnUpdateRCM = new javax.swing.JButton(); deleteButton = new javax.swing.JButton(); itemButtonPanel = new javax.swing.JPanel(); btnAddItem = new javax.swing.JButton(); btnUpdateItem = new javax.swing.JButton(); serviceButtonPanel = new javax.swing.JPanel(); btnServiceNow = new javax.swing.JButton(); statButtonPanel = new javax.swing.JPanel(); btnShowStat = new javax.swing.JButton(); userTypePanel = new javax.swing.JPanel(); userTypeAdminButton = new javax.swing.JButton(); userTypeCustomerButton = new javax.swing.JButton(); exitAdminButton = new javax.swing.JButton(); rightPanel = new javax.swing.JPanel(); welcomePanel = new javax.swing.JPanel(); WelcomePicTable = new javax.swing.JLabel(); loginPanel = new javax.swing.JPanel(); userNameLabel = new javax.swing.JLabel(); passwordLabel = new javax.swing.JLabel(); userNameTextField = new javax.swing.JTextField(); passwordTextField = new javax.swing.JTextField(); loginButton = new javax.swing.JButton(); loginExitButton = new javax.swing.JButton(); serviceUpdatePanel = new javax.swing.JPanel(); listRCMPanel = new javax.swing.JPanel(); showStatPanel = new javax.swing.JPanel(); userTypeRcmPanel = new javax.swing.JPanel(); userTypeRcmSelectComboBox = new javax.swing.JComboBox<>(); userTypeRcmSelectLabel = new javax.swing.JLabel(); userTypeIStartButton = new javax.swing.JButton(); userTypeIExitButton = new javax.swing.JButton(); startDepositParentPanel = new javax.swing.JPanel(); startDepositDefaultPanel = new javax.swing.JPanel(); startDepositPanel = new javax.swing.JPanel(); userTypeItemSelectLabel = new javax.swing.JLabel(); userTypeItemSelectComboBox = new javax.swing.JComboBox<>(); userTypePlaceActionButton = new javax.swing.JButton(); paymentTypePanel = new javax.swing.JPanel(); paymentTypeMessagePanel = new javax.swing.JLabel(); paymentMethodCashButton = new javax.swing.JButton(); paymentMethodCouponButton = new javax.swing.JButton(); metricTypePanel = new javax.swing.JPanel(); yesMetricButton = new javax.swing.JButton(); noMetricButton = new javax.swing.JButton(); metricMessageLabel = new javax.swing.JLabel(); startDepositTransactionMessageLabel = new javax.swing.JLabel(); startDepositWeightMessageLabel = new javax.swing.JLabel(); startDepositTotalAmountMessageLabel = new javax.swing.JLabel(); startDepositTransactionMessageLabel1 = new javax.swing.JLabel(); servicePanel = new javax.swing.JPanel(); rcmStatDisplayPanel = new javax.swing.JPanel(); rcmStatNameLabel = new javax.swing.JLabel(); rcmStatTotalCapacityLabel = new javax.swing.JLabel(); rcmStatCurrentTotalCapacityLabel = new javax.swing.JLabel(); rcmStatCurrentTotalAmountLabel = new javax.swing.JLabel(); rcmStatTotalAmountLabel = new javax.swing.JLabel(); emptyRefilMessageLabel = new javax.swing.JLabel(); rcmStatLastServicedLabel = new javax.swing.JLabel(); serviceNowRcmSelectionComboBox = new javax.swing.JComboBox<>(); serviceRcmSelectionErrorLabel = new javax.swing.JLabel(); serviceParentPanel = new javax.swing.JPanel(); serviceChildPanel = new javax.swing.JPanel(); serviceCapacityButton = new javax.swing.JButton(); serviceAmountButton = new javax.swing.JButton(); ServiceBlankPanel = new javax.swing.JPanel(); itemRemovePanel = new javax.swing.JPanel(); itemRemoveRecycTypLabel = new javax.swing.JLabel(); itemRemoveTypeComboBox = new javax.swing.JComboBox<>(); itemRemoveTextField = new javax.swing.JTextField(); itemRemovePriceWeightLabel = new javax.swing.JLabel(); itemRemoveButton = new javax.swing.JButton(); itemUpdatePanel = new javax.swing.JPanel(); itemUpdateRecycTypLabel = new javax.swing.JLabel(); itemUpdatePriceWeighTextField = new javax.swing.JTextField(); itemUpdateTypeComboBox = new javax.swing.JComboBox<>(); itemUpdateButton = new javax.swing.JButton(); itemUpdatePriceWeightLabel = new javax.swing.JLabel(); itemAddPanel = new javax.swing.JPanel(); itemAddTypeLabel = new javax.swing.JLabel(); itemAddPriceWeightLabel = new javax.swing.JLabel(); itemAddPriceWtTextField = new javax.swing.JTextField(); itemAddButton = new javax.swing.JButton(); itemAddTypeTextField = new javax.swing.JTextField(); updateRCMPanel = new javax.swing.JPanel(); updateActivateCheckBox = new javax.swing.JCheckBox(); updateRcmButton = new javax.swing.JButton(); updateRcmLabel = new javax.swing.JLabel(); updateRCMSelectComboBox = new javax.swing.JComboBox<>(); updateRcmCapacityTextField = new javax.swing.JTextField(); updateRcmCapacityLabel = new javax.swing.JLabel(); updateRcmLocationLabel = new javax.swing.JLabel(); updateRcmLocationComboBox = new javax.swing.JComboBox<>(); rcmItemListPanel1 = new javax.swing.JPanel(); jCB1 = new javax.swing.JCheckBox(); jCB2 = new javax.swing.JCheckBox(); jCB3 = new javax.swing.JCheckBox(); jCB4 = new javax.swing.JCheckBox(); updateRcmTotalAmountLabel = new javax.swing.JLabel(); updateRcmTotalAmountTextField = new javax.swing.JTextField(); addRCMPanel = new javax.swing.JPanel(); rcmNameLabel = new javax.swing.JLabel(); rcmAddButton = new javax.swing.JButton(); rcmCapacityLabel = new javax.swing.JLabel(); rcmCapacityTextField = new javax.swing.JTextField(); rcmLocationLabel = new javax.swing.JLabel(); rcmLocationComboBox = new javax.swing.JComboBox<>(); rcmItemListPanel = new javax.swing.JPanel(); jCheckBox1 = new javax.swing.JCheckBox(); jCheckBox2 = new javax.swing.JCheckBox(); jCheckBox3 = new javax.swing.JCheckBox(); jCheckBox4 = new javax.swing.JCheckBox(); rcmNameTextField = new javax.swing.JTextField(); rcmTotalAmountLabel = new javax.swing.JLabel(); rcmTotalAmountTextField = new javax.swing.JTextField(); actionCompleteMessagePanel = new javax.swing.JPanel(); actionCompleteMessageLabel = new javax.swing.JLabel(); deleteRcmPanel = new javax.swing.JPanel(); deleteRcmSelectionComboBox = new javax.swing.JComboBox<>(); rcmLabel = new javax.swing.JLabel(); deleteRcmButton = new javax.swing.JButton(); jLabel1.setText("jLabel1"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("RMOS GUI"); leftUpperPanel.setBackground(new java.awt.Color(204, 255, 204)); leftUpperPanel.setOpaque(false); iconLabel.setFocusable(false); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel2.setText("ECO RECYCLE"); javax.swing.GroupLayout leftUpperPanelLayout = new javax.swing.GroupLayout(leftUpperPanel); leftUpperPanel.setLayout(leftUpperPanelLayout); leftUpperPanelLayout.setHorizontalGroup( leftUpperPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(leftUpperPanelLayout.createSequentialGroup().addContainerGap(22, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(iconLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))); leftUpperPanelLayout.setVerticalGroup( leftUpperPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(iconLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE) .addGroup(leftUpperPanelLayout.createSequentialGroup().addGap(50, 50, 50) .addComponent(jLabel2) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); leftLowerPanel.setBackground(new java.awt.Color(0, 102, 102)); rcmButtonPanel.setBackground(new java.awt.Color(204, 204, 255)); rcmButtonPanel.setBorder(javax.swing.BorderFactory.createTitledBorder( new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED), "RCM")); rcmButtonPanel.setOpaque(false); btnAddRCM.setText("Add"); btnAddRCM.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAddRCMActionPerformed(evt); } }); btnUpdateRCM.setText("Update"); btnUpdateRCM.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnUpdateRCMActionPerformed(evt); } }); deleteButton.setText("Delete"); deleteButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteButtonActionPerformed(evt); } }); javax.swing.GroupLayout rcmButtonPanelLayout = new javax.swing.GroupLayout(rcmButtonPanel); rcmButtonPanel.setLayout(rcmButtonPanelLayout); rcmButtonPanelLayout.setHorizontalGroup( rcmButtonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmButtonPanelLayout.createSequentialGroup().addContainerGap() .addComponent(btnAddRCM, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(btnUpdateRCM) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(deleteButton).addContainerGap())); rcmButtonPanelLayout.setVerticalGroup(rcmButtonPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmButtonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnAddRCM, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnUpdateRCM).addComponent(deleteButton))); itemButtonPanel.setBackground(new java.awt.Color(255, 0, 0)); itemButtonPanel.setBorder(javax.swing.BorderFactory .createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), "Item")); itemButtonPanel.setOpaque(false); btnAddItem.setText("Add"); btnAddItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAddItemActionPerformed(evt); } }); btnUpdateItem.setText("Update"); btnUpdateItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnUpdateItemActionPerformed(evt); } }); javax.swing.GroupLayout itemButtonPanelLayout = new javax.swing.GroupLayout(itemButtonPanel); itemButtonPanel.setLayout(itemButtonPanelLayout); itemButtonPanelLayout.setHorizontalGroup( itemButtonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemButtonPanelLayout.createSequentialGroup().addGap(6, 6, 6) .addComponent(btnAddItem, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnUpdateItem).addContainerGap())); itemButtonPanelLayout.setVerticalGroup(itemButtonPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemButtonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnAddItem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnUpdateItem))); serviceButtonPanel.setBorder(javax.swing.BorderFactory.createTitledBorder( new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED), "Service")); serviceButtonPanel.setOpaque(false); btnServiceNow.setText("Refill / Empty"); btnServiceNow.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnServiceNowActionPerformed(evt); } }); javax.swing.GroupLayout serviceButtonPanelLayout = new javax.swing.GroupLayout(serviceButtonPanel); serviceButtonPanel.setLayout(serviceButtonPanelLayout); serviceButtonPanelLayout.setHorizontalGroup( serviceButtonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(serviceButtonPanelLayout.createSequentialGroup().addGap(60, 60, 60) .addComponent(btnServiceNow, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); serviceButtonPanelLayout.setVerticalGroup( serviceButtonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnServiceNow, javax.swing.GroupLayout.Alignment.TRAILING)); statButtonPanel.setBackground(new java.awt.Color(51, 255, 51)); statButtonPanel.setBorder(javax.swing.BorderFactory.createTitledBorder( new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED), "Statistics")); statButtonPanel.setOpaque(false); btnShowStat.setText("Show Statistics"); btnShowStat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnShowStatActionPerformed(evt); } }); javax.swing.GroupLayout statButtonPanelLayout = new javax.swing.GroupLayout(statButtonPanel); statButtonPanel.setLayout(statButtonPanelLayout); statButtonPanelLayout.setHorizontalGroup( statButtonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(statButtonPanelLayout.createSequentialGroup().addGap(63, 63, 63) .addComponent(btnShowStat) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); statButtonPanelLayout.setVerticalGroup(statButtonPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(btnShowStat)); userTypePanel.setBorder(javax.swing.BorderFactory.createTitledBorder( new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED), "Uer Type")); userTypePanel.setOpaque(false); userTypeAdminButton.setText("Administrator"); userTypeAdminButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userTypeAdminButtonActionPerformed(evt); } }); userTypeCustomerButton.setText("Customer"); userTypeCustomerButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userTypeCustomerButtonActionPerformed(evt); } }); javax.swing.GroupLayout userTypePanelLayout = new javax.swing.GroupLayout(userTypePanel); userTypePanel.setLayout(userTypePanelLayout); userTypePanelLayout.setHorizontalGroup( userTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(userTypePanelLayout.createSequentialGroup().addContainerGap() .addComponent(userTypeAdminButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(userTypeCustomerButton).addContainerGap())); userTypePanelLayout .setVerticalGroup(userTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(userTypePanelLayout.createSequentialGroup().addContainerGap() .addGroup(userTypePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(userTypeAdminButton).addComponent(userTypeCustomerButton)) .addContainerGap(16, Short.MAX_VALUE))); exitAdminButton.setText("Exit Admin"); exitAdminButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitAdminButtonActionPerformed(evt); } }); javax.swing.GroupLayout leftLowerPanelLayout = new javax.swing.GroupLayout(leftLowerPanel); leftLowerPanel.setLayout(leftLowerPanelLayout); leftLowerPanelLayout.setHorizontalGroup( leftLowerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rcmButtonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(serviceButtonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(statButtonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(itemButtonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(userTypePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(leftLowerPanelLayout.createSequentialGroup().addGap(93, 93, 93) .addComponent(exitAdminButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); leftLowerPanelLayout.setVerticalGroup(leftLowerPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(leftLowerPanelLayout.createSequentialGroup() .addComponent(rcmButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(itemButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(serviceButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(statButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(userTypePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exitAdminButton).addGap(0, 0, Short.MAX_VALUE))); javax.swing.GroupLayout leftPanelLayout = new javax.swing.GroupLayout(leftPanel); leftPanel.setLayout(leftPanelLayout); leftPanelLayout .setHorizontalGroup(leftPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(leftUpperPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(leftLowerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); leftPanelLayout.setVerticalGroup(leftPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(leftPanelLayout.createSequentialGroup() .addComponent(leftUpperPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(leftLowerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); rightPanel.setLayout(new java.awt.CardLayout()); welcomePanel.setBackground(new java.awt.Color(0, 0, 0)); WelcomePicTable.setBackground(new java.awt.Color(0, 0, 0)); WelcomePicTable.setIcon( new javax.swing.ImageIcon("E:\\Software\\NetBeans Projects\\EcoRecycleSimulator\\Drawing (1).png")); // NOI18N javax.swing.GroupLayout welcomePanelLayout = new javax.swing.GroupLayout(welcomePanel); welcomePanel.setLayout(welcomePanelLayout); welcomePanelLayout.setHorizontalGroup(welcomePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, welcomePanelLayout.createSequentialGroup() .addContainerGap(96, Short.MAX_VALUE).addComponent(WelcomePicTable).addGap(89, 89, 89))); welcomePanelLayout .setVerticalGroup(welcomePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(welcomePanelLayout.createSequentialGroup().addGap(176, 176, 176) .addComponent(WelcomePicTable).addContainerGap(251, Short.MAX_VALUE))); rightPanel.add(welcomePanel, "card12"); loginPanel.setBackground(new java.awt.Color(255, 255, 204)); userNameLabel.setText("User Name"); passwordLabel.setText("Password"); loginButton.setText("Login"); loginButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loginButtonActionPerformed(evt); } }); loginExitButton.setText("Exit"); loginExitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loginExitButtonActionPerformed(evt); } }); javax.swing.GroupLayout loginPanelLayout = new javax.swing.GroupLayout(loginPanel); loginPanel.setLayout(loginPanelLayout); loginPanelLayout.setHorizontalGroup(loginPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(loginPanelLayout.createSequentialGroup().addGap(57, 57, 57).addGroup( loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(userNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(passwordLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(loginPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(userNameTextField).addComponent(passwordTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(loginPanelLayout.createSequentialGroup() .addComponent(loginButton, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(loginExitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(105, Short.MAX_VALUE))); loginPanelLayout .setVerticalGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(loginPanelLayout.createSequentialGroup().addGap(159, 159, 159) .addGroup(loginPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(userNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(userNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(loginPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(passwordLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(passwordTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(45, 45, 45) .addGroup(loginPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(loginButton, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(loginExitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(228, Short.MAX_VALUE))); rightPanel.add(loginPanel, "card8"); serviceUpdatePanel.setBackground(new java.awt.Color(0, 255, 255)); javax.swing.GroupLayout serviceUpdatePanelLayout = new javax.swing.GroupLayout(serviceUpdatePanel); serviceUpdatePanel.setLayout(serviceUpdatePanelLayout); serviceUpdatePanelLayout.setHorizontalGroup(serviceUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 400, Short.MAX_VALUE)); serviceUpdatePanelLayout.setVerticalGroup(serviceUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 548, Short.MAX_VALUE)); rightPanel.add(serviceUpdatePanel, "card11"); listRCMPanel.setBackground(new java.awt.Color(153, 255, 51)); javax.swing.GroupLayout listRCMPanelLayout = new javax.swing.GroupLayout(listRCMPanel); listRCMPanel.setLayout(listRCMPanelLayout); listRCMPanelLayout.setHorizontalGroup(listRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 400, Short.MAX_VALUE)); listRCMPanelLayout.setVerticalGroup(listRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 548, Short.MAX_VALUE)); rightPanel.add(listRCMPanel, "card10"); showStatPanel.setBackground(new java.awt.Color(255, 153, 0)); userTypeRcmPanel.setBackground(new java.awt.Color(255, 255, 102)); userTypeRcmPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "RCM")); userTypeRcmSelectComboBox.setToolTipText("Select a Recycling Machine"); userTypeRcmSelectLabel.setText("RCM"); userTypeIStartButton.setText("Start "); userTypeIStartButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userTypeIStartButtonActionPerformed(evt); } }); userTypeIExitButton.setText("Exit"); userTypeIExitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userTypeIExitButtonActionPerformed(evt); } }); startDepositParentPanel.setOpaque(false); startDepositParentPanel.setLayout(new java.awt.CardLayout()); startDepositDefaultPanel.setOpaque(false); javax.swing.GroupLayout startDepositDefaultPanelLayout = new javax.swing.GroupLayout( startDepositDefaultPanel); startDepositDefaultPanel.setLayout(startDepositDefaultPanelLayout); startDepositDefaultPanelLayout.setHorizontalGroup(startDepositDefaultPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 349, Short.MAX_VALUE)); startDepositDefaultPanelLayout.setVerticalGroup(startDepositDefaultPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100, Short.MAX_VALUE)); startDepositParentPanel.add(startDepositDefaultPanel, "card3"); startDepositPanel.setOpaque(false); userTypeItemSelectLabel.setText("Type"); userTypeItemSelectComboBox.setToolTipText("Select a Recycling Machine"); userTypeItemSelectComboBox.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { userTypeItemSelectComboBoxMouseReleased(evt); } }); userTypeItemSelectComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userTypeItemSelectComboBoxActionPerformed(evt); } }); userTypePlaceActionButton.setText("Place"); userTypePlaceActionButton.setToolTipText("Place item in Slot"); userTypePlaceActionButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userTypePlaceActionButtonActionPerformed(evt); } }); javax.swing.GroupLayout startDepositPanelLayout = new javax.swing.GroupLayout(startDepositPanel); startDepositPanel.setLayout(startDepositPanelLayout); startDepositPanelLayout.setHorizontalGroup( startDepositPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(startDepositPanelLayout.createSequentialGroup().addGap(29, 29, 29) .addComponent(userTypeItemSelectLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(userTypeItemSelectComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(userTypePlaceActionButton) .addContainerGap(21, Short.MAX_VALUE))); startDepositPanelLayout.setVerticalGroup(startDepositPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(startDepositPanelLayout.createSequentialGroup().addContainerGap() .addGroup(startDepositPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(userTypeItemSelectLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(userTypeItemSelectComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(userTypePlaceActionButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(53, Short.MAX_VALUE))); startDepositParentPanel.add(startDepositPanel, "card2"); paymentTypePanel.setOpaque(false); paymentTypeMessagePanel.setText("Please choose a payment type"); paymentMethodCashButton.setText("Cash"); paymentMethodCashButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { paymentMethodCashButtonActionPerformed(evt); } }); paymentMethodCouponButton.setText("Coupon"); paymentMethodCouponButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { paymentMethodCouponButtonActionPerformed(evt); } }); javax.swing.GroupLayout paymentTypePanelLayout = new javax.swing.GroupLayout(paymentTypePanel); paymentTypePanel.setLayout(paymentTypePanelLayout); paymentTypePanelLayout.setHorizontalGroup( paymentTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(paymentTypePanelLayout.createSequentialGroup().addGap(48, 48, 48) .addComponent(paymentMethodCashButton, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(paymentMethodCouponButton, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(48, 48, 48)) .addGroup(paymentTypePanelLayout.createSequentialGroup().addGap(85, 85, 85) .addComponent(paymentTypeMessagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(80, Short.MAX_VALUE))); paymentTypePanelLayout.setVerticalGroup( paymentTypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(paymentTypePanelLayout.createSequentialGroup().addContainerGap() .addComponent(paymentTypeMessagePanel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(paymentTypePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(paymentMethodCouponButton, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE) .addComponent(paymentMethodCashButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(34, Short.MAX_VALUE))); startDepositParentPanel.add(paymentTypePanel, "card4"); metricTypePanel.setOpaque(false); yesMetricButton.setText("YES"); yesMetricButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { yesMetricButtonActionPerformed(evt); } }); noMetricButton.setText("NO"); noMetricButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { noMetricButtonActionPerformed(evt); } }); metricMessageLabel.setText("Do you wish to view the weight in kilograms?"); javax.swing.GroupLayout metricTypePanelLayout = new javax.swing.GroupLayout(metricTypePanel); metricTypePanel.setLayout(metricTypePanelLayout); metricTypePanelLayout.setHorizontalGroup(metricTypePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, metricTypePanelLayout.createSequentialGroup() .addGap(66, 66, 66) .addGroup(metricTypePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(metricMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) .addGroup( metricTypePanelLayout.createSequentialGroup().addComponent(yesMetricButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(noMetricButton))) .addGap(68, 68, 68))); metricTypePanelLayout.setVerticalGroup(metricTypePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, metricTypePanelLayout.createSequentialGroup() .addContainerGap(18, Short.MAX_VALUE).addComponent(metricMessageLabel).addGap(18, 18, 18) .addGroup(metricTypePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(yesMetricButton).addComponent(noMetricButton)) .addGap(27, 27, 27))); startDepositParentPanel.add(metricTypePanel, "card5"); startDepositTransactionMessageLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N startDepositTransactionMessageLabel.setForeground(new java.awt.Color(51, 204, 0)); startDepositTransactionMessageLabel.setText("jlab"); startDepositWeightMessageLabel.setText("jlab1"); startDepositTotalAmountMessageLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N startDepositTotalAmountMessageLabel.setText("jlab2"); startDepositTransactionMessageLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N startDepositTransactionMessageLabel1.setForeground(new java.awt.Color(51, 204, 0)); startDepositTransactionMessageLabel1.setText("jLabel2"); javax.swing.GroupLayout userTypeRcmPanelLayout = new javax.swing.GroupLayout(userTypeRcmPanel); userTypeRcmPanel.setLayout(userTypeRcmPanelLayout); userTypeRcmPanelLayout.setHorizontalGroup(userTypeRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(userTypeRcmPanelLayout.createSequentialGroup().addGroup(userTypeRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(userTypeRcmPanelLayout.createSequentialGroup().addContainerGap().addComponent( startDepositParentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(userTypeRcmPanelLayout.createSequentialGroup().addGap(36, 36, 36) .addGroup(userTypeRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(userTypeRcmPanelLayout.createSequentialGroup() .addComponent(userTypeIStartButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(userTypeIExitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(userTypeRcmPanelLayout.createSequentialGroup() .addComponent(userTypeRcmSelectLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(userTypeRcmSelectComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(startDepositTransactionMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(startDepositWeightMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(startDepositTotalAmountMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(startDepositTransactionMessageLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))) .addGap(29, 29, 29))); userTypeRcmPanelLayout.setVerticalGroup(userTypeRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(userTypeRcmPanelLayout.createSequentialGroup().addGap(32, 32, 32) .addGroup(userTypeRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(userTypeRcmSelectComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(userTypeRcmSelectLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(userTypeRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(userTypeIStartButton, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(userTypeIExitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(35, 35, 35) .addComponent(startDepositTransactionMessageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(startDepositTransactionMessageLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(startDepositWeightMessageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 11, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(startDepositTotalAmountMessageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 81, Short.MAX_VALUE) .addComponent(startDepositParentPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(97, 97, 97))); javax.swing.GroupLayout showStatPanelLayout = new javax.swing.GroupLayout(showStatPanel); showStatPanel.setLayout(showStatPanelLayout); showStatPanelLayout.setHorizontalGroup( showStatPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( userTypeRcmPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); showStatPanelLayout .setVerticalGroup(showStatPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(userTypeRcmPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); rightPanel.add(showStatPanel, "card8"); servicePanel.setBackground(new java.awt.Color(102, 255, 153)); rcmStatDisplayPanel.setOpaque(false); rcmStatNameLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N rcmStatNameLabel.setText("a"); rcmStatTotalCapacityLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N rcmStatTotalCapacityLabel.setText("b"); rcmStatCurrentTotalCapacityLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N rcmStatCurrentTotalCapacityLabel.setText("c"); rcmStatCurrentTotalAmountLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N rcmStatCurrentTotalAmountLabel.setText("d"); rcmStatTotalAmountLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N rcmStatTotalAmountLabel.setText("e"); emptyRefilMessageLabel.setForeground(new java.awt.Color(255, 51, 51)); emptyRefilMessageLabel.setText("f"); rcmStatLastServicedLabel.setText("jLabel3"); javax.swing.GroupLayout rcmStatDisplayPanelLayout = new javax.swing.GroupLayout(rcmStatDisplayPanel); rcmStatDisplayPanel.setLayout(rcmStatDisplayPanelLayout); rcmStatDisplayPanelLayout.setHorizontalGroup(rcmStatDisplayPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rcmStatCurrentTotalCapacityLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rcmStatNameLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rcmStatTotalCapacityLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rcmStatCurrentTotalAmountLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rcmStatTotalAmountLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(emptyRefilMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rcmStatLastServicedLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)); rcmStatDisplayPanelLayout.setVerticalGroup(rcmStatDisplayPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmStatDisplayPanelLayout.createSequentialGroup().addGap(23, 23, 23) .addComponent(rcmStatNameLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rcmStatCurrentTotalCapacityLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(rcmStatTotalCapacityLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(rcmStatCurrentTotalAmountLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(rcmStatTotalAmountLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE) .addComponent(rcmStatLastServicedLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(emptyRefilMessageLabel).addGap(27, 27, 27))); serviceNowRcmSelectionComboBox .setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Select a RCM" })); serviceNowRcmSelectionComboBox.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { serviceNowRcmSelectionComboBoxMouseReleased(evt); } }); serviceNowRcmSelectionComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { serviceNowRcmSelectionComboBoxActionPerformed(evt); } }); serviceRcmSelectionErrorLabel.setFont(new java.awt.Font("Calibri Light", 1, 12)); // NOI18N serviceRcmSelectionErrorLabel.setForeground(new java.awt.Color(255, 204, 0)); serviceParentPanel.setLayout(new java.awt.CardLayout()); serviceCapacityButton.setText("Empty Items"); serviceCapacityButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { serviceCapacityButtonActionPerformed(evt); } }); serviceAmountButton.setText("Refill Funds"); serviceAmountButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { serviceAmountButtonActionPerformed(evt); } }); javax.swing.GroupLayout serviceChildPanelLayout = new javax.swing.GroupLayout(serviceChildPanel); serviceChildPanel.setLayout(serviceChildPanelLayout); serviceChildPanelLayout.setHorizontalGroup(serviceChildPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(serviceChildPanelLayout.createSequentialGroup().addGap(23, 23, 23) .addComponent(serviceCapacityButton, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE) .addComponent(serviceAmountButton, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29))); serviceChildPanelLayout.setVerticalGroup( serviceChildPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(serviceChildPanelLayout.createSequentialGroup().addContainerGap() .addGroup(serviceChildPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(serviceCapacityButton).addComponent(serviceAmountButton)) .addContainerGap(65, Short.MAX_VALUE))); serviceParentPanel.add(serviceChildPanel, "card2"); javax.swing.GroupLayout ServiceBlankPanelLayout = new javax.swing.GroupLayout(ServiceBlankPanel); ServiceBlankPanel.setLayout(ServiceBlankPanelLayout); ServiceBlankPanelLayout.setHorizontalGroup(ServiceBlankPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 311, Short.MAX_VALUE)); ServiceBlankPanelLayout.setVerticalGroup(ServiceBlankPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 99, Short.MAX_VALUE)); serviceParentPanel.add(ServiceBlankPanel, "card3"); javax.swing.GroupLayout servicePanelLayout = new javax.swing.GroupLayout(servicePanel); servicePanel.setLayout(servicePanelLayout); servicePanelLayout.setHorizontalGroup(servicePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(servicePanelLayout.createSequentialGroup().addGroup(servicePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(servicePanelLayout.createSequentialGroup().addGap(129, 129, 129).addComponent( serviceNowRcmSelectionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(servicePanelLayout.createSequentialGroup().addGap(165, 165, 165) .addComponent(serviceRcmSelectionErrorLabel)) .addGroup(servicePanelLayout.createSequentialGroup().addGap(34, 34, 34) .addGroup(servicePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(serviceParentPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 311, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rcmStatDisplayPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(0, 55, Short.MAX_VALUE))); servicePanelLayout.setVerticalGroup(servicePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(servicePanelLayout.createSequentialGroup().addGap(95, 95, 95) .addComponent(serviceRcmSelectionErrorLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(serviceNowRcmSelectionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37) .addComponent(rcmStatDisplayPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(serviceParentPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); rightPanel.add(servicePanel, "card7"); itemRemovePanel.setBackground(new java.awt.Color(255, 51, 51)); itemRemoveRecycTypLabel.setText("Recyclable Type"); itemRemoveTypeComboBox.setModel( new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); itemRemoveTextField.setText("jTextField1"); itemRemovePriceWeightLabel.setText("Price / Weight"); itemRemoveButton.setText("Add Item"); javax.swing.GroupLayout itemRemovePanelLayout = new javax.swing.GroupLayout(itemRemovePanel); itemRemovePanel.setLayout(itemRemovePanelLayout); itemRemovePanelLayout.setHorizontalGroup(itemRemovePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 400, Short.MAX_VALUE) .addGroup(itemRemovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemRemovePanelLayout.createSequentialGroup().addGap(60, 60, 60) .addGroup(itemRemovePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(itemRemovePriceWeightLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(itemRemoveRecycTypLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)) .addGroup(itemRemovePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemRemovePanelLayout.createSequentialGroup().addGap(18, 18, 18) .addComponent(itemRemoveTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(itemRemovePanelLayout.createSequentialGroup().addGap(18, 18, 18) .addGroup(itemRemovePanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(itemRemoveTextField) .addComponent(itemRemoveButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap(58, Short.MAX_VALUE)))); itemRemovePanelLayout.setVerticalGroup(itemRemovePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 548, Short.MAX_VALUE) .addGroup(itemRemovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemRemovePanelLayout.createSequentialGroup().addGap(187, 187, 187) .addGroup(itemRemovePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(itemRemoveTypeComboBox, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE) .addComponent(itemRemoveRecycTypLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(itemRemovePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(itemRemovePriceWeightLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(itemRemoveTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(itemRemoveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(236, Short.MAX_VALUE)))); rightPanel.add(itemRemovePanel, "card6"); itemUpdatePanel.setBackground(new java.awt.Color(153, 51, 255)); itemUpdateRecycTypLabel.setText("Recyclable Type"); itemUpdatePriceWeighTextField.setText("jTextField1"); itemUpdatePriceWeighTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { itemUpdatePriceWeighTextFieldMouseClicked(evt); } }); itemUpdatePriceWeighTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { itemUpdatePriceWeighTextFieldKeyTyped(evt); } }); itemUpdateButton.setText("Update Item"); itemUpdateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { itemUpdateButtonActionPerformed(evt); } }); itemUpdatePriceWeightLabel.setText("Price / Weight"); javax.swing.GroupLayout itemUpdatePanelLayout = new javax.swing.GroupLayout(itemUpdatePanel); itemUpdatePanel.setLayout(itemUpdatePanelLayout); itemUpdatePanelLayout.setHorizontalGroup(itemUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemUpdatePanelLayout.createSequentialGroup().addGap(34, 34, 34) .addGroup(itemUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(itemUpdatePriceWeightLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(itemUpdateRecycTypLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(itemUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemUpdatePanelLayout.createSequentialGroup().addGap(18, 18, 18) .addComponent(itemUpdateTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(itemUpdatePanelLayout.createSequentialGroup().addGap(18, 18, 18) .addGroup(itemUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(itemUpdatePriceWeighTextField).addComponent( itemUpdateButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGap(78, 78, 78))); itemUpdatePanelLayout.setVerticalGroup(itemUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemUpdatePanelLayout.createSequentialGroup().addGap(119, 119, 119) .addGroup(itemUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(itemUpdateTypeComboBox).addComponent(itemUpdateRecycTypLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(itemUpdatePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(itemUpdatePriceWeightLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(itemUpdatePriceWeighTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(itemUpdateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(280, Short.MAX_VALUE))); rightPanel.add(itemUpdatePanel, "card5"); itemAddPanel.setAutoscrolls(true); itemAddTypeLabel.setText("Type"); itemAddPriceWeightLabel.setText("Price / Weight"); itemAddPriceWtTextField.setText("Enter a numeric value"); itemAddPriceWtTextField.setToolTipText(""); itemAddPriceWtTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { itemAddPriceWtTextFieldMouseClicked(evt); } }); itemAddPriceWtTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { itemAddPriceWtTextFieldKeyTyped(evt); } }); itemAddButton.setText("Add Item"); itemAddButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { itemAddButtonActionPerformed(evt); } }); itemAddTypeTextField.setText("Enter a Recyclable Type"); itemAddTypeTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { itemAddTypeTextFieldMouseClicked(evt); } }); javax.swing.GroupLayout itemAddPanelLayout = new javax.swing.GroupLayout(itemAddPanel); itemAddPanel.setLayout(itemAddPanelLayout); itemAddPanelLayout.setHorizontalGroup(itemAddPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemAddPanelLayout.createSequentialGroup().addGap(43, 43, 43).addGroup(itemAddPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(itemAddPanelLayout.createSequentialGroup() .addComponent(itemAddTypeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(itemAddTypeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(itemAddPanelLayout.createSequentialGroup() .addComponent(itemAddPriceWeightLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(itemAddPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(itemAddPriceWtTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE) .addComponent(itemAddButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap(83, Short.MAX_VALUE))); itemAddPanelLayout.setVerticalGroup(itemAddPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(itemAddPanelLayout.createSequentialGroup().addGap(142, 142, 142) .addGroup(itemAddPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(itemAddTypeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(itemAddTypeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(50, 50, 50) .addGroup(itemAddPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(itemAddPriceWtTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(itemAddPriceWeightLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(itemAddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(224, Short.MAX_VALUE))); rightPanel.add(itemAddPanel, "card4"); updateRCMPanel.setBackground(new java.awt.Color(0, 51, 255)); updateActivateCheckBox.setText("Activate"); updateRcmButton.setText("Update RCM"); updateRcmButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { updateRcmButtonActionPerformed(evt); } }); updateRcmLabel.setText("RCM"); updateRCMSelectComboBox.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { updateRCMSelectComboBoxMouseReleased(evt); } }); updateRCMSelectComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { updateRCMSelectComboBoxActionPerformed(evt); } }); updateRcmCapacityTextField.setText("Enter an Integer Value"); updateRcmCapacityTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { updateRcmCapacityTextFieldMouseClicked(evt); } }); updateRcmCapacityTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { updateRcmCapacityTextFieldKeyTyped(evt); } }); updateRcmCapacityLabel.setText("Set Total Capacity"); updateRcmLocationLabel.setText("Location"); updateRcmLocationComboBox.setModel(new javax.swing.DefaultComboBoxModel<>( new String[] { "North Campus", "South Campus", "East Campus", "West Campus" })); rcmItemListPanel1.setBackground(new java.awt.Color(0, 255, 153)); javax.swing.GroupLayout rcmItemListPanel1Layout = new javax.swing.GroupLayout(rcmItemListPanel1); rcmItemListPanel1.setLayout(rcmItemListPanel1Layout); rcmItemListPanel1Layout.setHorizontalGroup(rcmItemListPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmItemListPanel1Layout.createSequentialGroup().addContainerGap().addComponent(jCB1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jCB2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jCB3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jCB4) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); rcmItemListPanel1Layout.setVerticalGroup( rcmItemListPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmItemListPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(rcmItemListPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmItemListPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCB1).addComponent(jCB2).addComponent(jCB3)) .addComponent(jCB4)) .addContainerGap(44, Short.MAX_VALUE))); updateRcmTotalAmountLabel.setText("Set Total Amount"); updateRcmTotalAmountLabel.setToolTipText(""); updateRcmTotalAmountTextField.setText("Enter an Integer Value"); updateRcmTotalAmountTextField.setToolTipText("Enter Total RCM Capacity"); updateRcmTotalAmountTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { updateRcmTotalAmountTextFieldMouseClicked(evt); } }); updateRcmTotalAmountTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { updateRcmTotalAmountTextFieldKeyTyped(evt); } }); javax.swing.GroupLayout updateRCMPanelLayout = new javax.swing.GroupLayout(updateRCMPanel); updateRCMPanel.setLayout(updateRCMPanelLayout); updateRCMPanelLayout.setHorizontalGroup( updateRCMPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, updateRCMPanelLayout.createSequentialGroup().addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(updateRCMPanelLayout.createSequentialGroup().addContainerGap() .addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(rcmItemListPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(updateRCMPanelLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE).addComponent(updateRcmButton, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, updateRCMPanelLayout .createSequentialGroup().addGap(29, 29, 29) .addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(updateRcmCapacityLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE) .addComponent(updateRcmLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(updateRcmLocationLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(updateRcmTotalAmountLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(updateRcmCapacityTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) .addComponent(updateRCMSelectComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(updateActivateCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(updateRcmLocationComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(updateRcmTotalAmountTextField)))) .addGap(26, 26, 26))); updateRCMPanelLayout.setVerticalGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, updateRCMPanelLayout.createSequentialGroup() .addGap(32, 32, 32) .addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(updateRCMSelectComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(updateRcmLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(updateRcmCapacityTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(updateRcmCapacityLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(updateRcmLocationComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(updateRcmLocationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(updateActivateCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(updateRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(updateRcmTotalAmountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(updateRcmTotalAmountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rcmItemListPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(35, 35, 35).addComponent(updateRcmButton, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(152, Short.MAX_VALUE))); rightPanel.add(updateRCMPanel, "card3"); addRCMPanel.setBackground(new java.awt.Color(204, 0, 102)); rcmNameLabel.setText("RCM Name"); rcmAddButton.setText("Add RCM"); rcmAddButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rcmAddButtonActionPerformed(evt); } }); rcmCapacityLabel.setText("Set Total Capacity"); rcmCapacityTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { rcmCapacityTextFieldMouseClicked(evt); } }); rcmCapacityTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { rcmCapacityTextFieldKeyTyped(evt); } }); rcmLocationLabel.setText("Location"); rcmLocationComboBox.setModel(new javax.swing.DefaultComboBoxModel<>( new String[] { "North Campus", "South Campus", "East Campus", "West Campus" })); rcmItemListPanel.setBackground(new java.awt.Color(0, 255, 153)); javax.swing.GroupLayout rcmItemListPanelLayout = new javax.swing.GroupLayout(rcmItemListPanel); rcmItemListPanel.setLayout(rcmItemListPanelLayout); rcmItemListPanelLayout.setHorizontalGroup(rcmItemListPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmItemListPanelLayout.createSequentialGroup().addContainerGap().addComponent(jCheckBox1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBox2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBox3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBox4) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); rcmItemListPanelLayout.setVerticalGroup(rcmItemListPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmItemListPanelLayout.createSequentialGroup().addContainerGap() .addGroup(rcmItemListPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(rcmItemListPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox1).addComponent(jCheckBox2).addComponent(jCheckBox3)) .addComponent(jCheckBox4)) .addContainerGap(58, Short.MAX_VALUE))); rcmNameTextField.setText("Eg. RCM01"); rcmNameTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { rcmNameTextFieldMouseClicked(evt); } }); rcmTotalAmountLabel.setText(" Set Amount Total"); rcmTotalAmountLabel.setToolTipText(""); rcmTotalAmountTextField.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { rcmTotalAmountTextFieldMouseClicked(evt); } }); rcmTotalAmountTextField.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { rcmTotalAmountTextFieldKeyTyped(evt); } }); javax.swing.GroupLayout addRCMPanelLayout = new javax.swing.GroupLayout(addRCMPanel); addRCMPanel.setLayout(addRCMPanelLayout); addRCMPanelLayout .setHorizontalGroup(addRCMPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addRCMPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( rcmAddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(73, 73, 73)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addRCMPanelLayout .createSequentialGroup().addGap(26, 26, 26) .addGroup(addRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent( rcmItemListPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(addRCMPanelLayout.createSequentialGroup() .addGroup(addRCMPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(rcmLocationLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rcmCapacityLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) .addComponent(rcmNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rcmTotalAmountLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(addRCMPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rcmTotalAmountTextField) .addComponent(rcmCapacityTextField, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(rcmLocationComboBox, javax.swing.GroupLayout.Alignment.TRAILING, 0, 158, Short.MAX_VALUE) .addComponent(rcmNameTextField)))) .addGap(74, 74, 74))); addRCMPanelLayout.setVerticalGroup(addRCMPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(addRCMPanelLayout.createSequentialGroup().addGap(37, 37, 37) .addGroup(addRCMPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rcmNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rcmNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(addRCMPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rcmCapacityLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rcmCapacityTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(addRCMPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rcmLocationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rcmLocationComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(addRCMPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rcmTotalAmountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rcmTotalAmountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rcmItemListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(rcmAddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(192, Short.MAX_VALUE))); rightPanel.add(addRCMPanel, "card2"); actionCompleteMessagePanel.setBackground(new java.awt.Color(204, 204, 255)); actionCompleteMessageLabel.setText("jLabel2"); javax.swing.GroupLayout actionCompleteMessagePanelLayout = new javax.swing.GroupLayout( actionCompleteMessagePanel); actionCompleteMessagePanel.setLayout(actionCompleteMessagePanelLayout); actionCompleteMessagePanelLayout.setHorizontalGroup( actionCompleteMessagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(actionCompleteMessagePanelLayout.createSequentialGroup().addGap(173, 173, 173) .addComponent(actionCompleteMessageLabel).addContainerGap(193, Short.MAX_VALUE))); actionCompleteMessagePanelLayout.setVerticalGroup( actionCompleteMessagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(actionCompleteMessagePanelLayout.createSequentialGroup().addGap(188, 188, 188) .addComponent(actionCompleteMessageLabel).addContainerGap(346, Short.MAX_VALUE))); rightPanel.add(actionCompleteMessagePanel, "card13"); deleteRcmPanel.setBackground(new java.awt.Color(204, 255, 153)); rcmLabel.setText("Choose RCM"); deleteRcmButton.setText("Delete"); deleteRcmButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteRcmButtonActionPerformed(evt); } }); javax.swing.GroupLayout deleteRcmPanelLayout = new javax.swing.GroupLayout(deleteRcmPanel); deleteRcmPanel.setLayout(deleteRcmPanelLayout); deleteRcmPanelLayout.setHorizontalGroup( deleteRcmPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(deleteRcmPanelLayout.createSequentialGroup().addGap(44, 44, 44) .addComponent(rcmLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(deleteRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(deleteRcmButton, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE) .addComponent(deleteRcmSelectionComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(161, Short.MAX_VALUE))); deleteRcmPanelLayout.setVerticalGroup(deleteRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(deleteRcmPanelLayout.createSequentialGroup().addGap(56, 56, 56) .addGroup(deleteRcmPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(deleteRcmSelectionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rcmLabel)) .addGap(31, 31, 31).addComponent(deleteRcmButton, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(406, Short.MAX_VALUE))); rightPanel.add(deleteRcmPanel, "card14"); javax.swing.GroupLayout mainFramePanelLayout = new javax.swing.GroupLayout(mainFramePanel); mainFramePanel.setLayout(mainFramePanelLayout); mainFramePanelLayout.setHorizontalGroup(mainFramePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainFramePanelLayout.createSequentialGroup() .addComponent(leftPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(rightPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); mainFramePanelLayout.setVerticalGroup(mainFramePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(leftPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(rightPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(mainFramePanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( mainFramePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); pack(); }// </editor-fold>//GEN-END:initComponents private void btnAddItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddItemActionPerformed // TODO add your handling code here: rightPanel.removeAll(); rightPanel.add(itemAddPanel); rightPanel.repaint(); rightPanel.validate(); }//GEN-LAST:event_btnAddItemActionPerformed private void btnUpdateItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateItemActionPerformed // TODO add your handling code here: rightPanel.removeAll(); rightPanel.add(itemUpdatePanel); rightPanel.repaint(); rightPanel.validate(); try { fillTypeComboBox(); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_btnUpdateItemActionPerformed private void btnServiceNowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnServiceNowActionPerformed // TODO add your handling code here: rightPanel.removeAll(); rightPanel.add(servicePanel); rightPanel.repaint(); rightPanel.validate(); serviceCapacityButton.setEnabled(false); serviceAmountButton.setEnabled(false); rcmStatCurrentTotalCapacityLabel.setText(""); rcmStatNameLabel.setText(""); rcmStatTotalAmountLabel.setText(""); rcmStatCurrentTotalAmountLabel.setText(""); rcmStatTotalCapacityLabel.setText(""); rcmNameLabel.setText(""); emptyRefilMessageLabel.setText(""); rcmStatLastServicedLabel.setText(""); // serviceNowRcmSelectionComboBox.removeAll(); // serviceNowRcmSelectionComboBox.repaint();; // serviceNowRcmSelectionComboBox.revalidate(); try { showRcmIdsForServiceFillCombo(); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_btnServiceNowActionPerformed private void btnAddRCMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddRCMActionPerformed // TODO add your handling code here: // jCheckBox1.setVisible(false); checkBoxVisibility(false); rightPanel.removeAll(); rightPanel.add(addRCMPanel); rightPanel.repaint(); rightPanel.validate(); try { ar = createCheckBoxes(); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_btnAddRCMActionPerformed private void btnUpdateRCMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateRCMActionPerformed // TODO add your handling code here: jCB1.setVisible(false); jCB2.setVisible(false); jCB3.setVisible(false); jCB4.setVisible(false); rightPanel.removeAll(); rightPanel.add(updateRCMPanel); rightPanel.repaint(); rightPanel.validate(); try { valueForFillCombo(); ar = createUpdateCheckBoxes(); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_btnUpdateRCMActionPerformed private void btnShowStatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnShowStatActionPerformed // TODO add your handling code here: // rightPanel.removeAll(); // rightPanel.add(showStatPanel); // rightPanel.repaint(); // rightPanel.validate(); getStat(); }//GEN-LAST:event_btnShowStatActionPerformed // ArrayList<Integer> idArray = new ArrayList<Integer>(5); void getStat() { DbConnect conn = new DbConnect(); ArrayList<String> name_array = new ArrayList<String>(); ArrayList<String> count_array = new ArrayList<String>(); try { String totalCount = conn.noOFTransactions(); Object[] name_and_count_array = new Object[10]; name_and_count_array = conn.getDetails(); name_array = (ArrayList<String>) name_and_count_array[0]; count_array = (ArrayList<String>) name_and_count_array[1]; } catch (SQLException ex) { // Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); System.out.println("Exception" + ex); } JOptionPane.showMessageDialog(null, name_array.size()); for (int i = 0; i < name_array.size(); i++) { System.out.print(name_array.get(i)); } DefaultPieDataset dp = new DefaultPieDataset(); for (int i = 0; i < name_array.size(); i++) { dp.setValue(name_array.get(i), Integer.parseInt(count_array.get(i))); } JFreeChart pieChart = ChartFactory.createPieChart("Statistical representation of Usage of RCM", dp, true, true, false); PiePlot p = (PiePlot) pieChart.getPlot(); ChartFrame cf = new ChartFrame("Pie Chart", pieChart); cf.setVisible(true); cf.setSize(750, 500); } private void rcmAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rcmAddButtonActionPerformed // TODO add your handling code here: String rcmName = rcmNameTextField.getText(); int rcmCapacity = Integer.parseInt(rcmCapacityTextField.getText()); String rcmLocation = rcmLocationComboBox.getSelectedItem().toString(); int rcmTotalAmount = Integer.parseInt(rcmTotalAmountTextField.getText()); // System.out.println(rcmTotalAmount+ "BASFASD"); ArrayList<Integer> idArray = new ArrayList<Integer>(5); JCheckBox tempCB[] = { jCheckBox1, jCheckBox2, jCheckBox3 }; if (jCheckBox1.isSelected() || jCheckBox2.isSelected() || jCheckBox3.isSelected()) { for (int i = 0; i < tempCB.length; i++) { if (tempCB[i].isSelected()) { // System.out.println(tempCB[i].getText()); int tempID = 0; try { // tempCB[i]. tempID = getTypeId(tempCB[i].getText()); System.out.println(tempID); idArray.add(tempID); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } } } // System.out.println("Showing id values "); // for(Integer number: idArray) // { // System.out.println(number); // } // System.out.println(idArray.size()); insertRcm(idArray, rcmName, rcmCapacity, rcmLocation, rcmTotalAmount); } else { JOptionPane.showMessageDialog(null, "Atleast one of Plastic/ Aluminium/ Glass needs to be selected"); } }//GEN-LAST:event_rcmAddButtonActionPerformed private void rcmCapacityTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_rcmCapacityTextFieldKeyTyped // TODO add your handling code here: char input = evt.getKeyChar(); // if(!(Character.isDigit(input))|| (input==KeyEvent.VK_BACK_SPACE)||(input==KeyEvent.VK_DELETE)) // { // getToolkit().beep(); // evt.consume(); // } validateForInteger(input, evt); }//GEN-LAST:event_rcmCapacityTextFieldKeyTyped private void updateRcmCapacityTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_updateRcmCapacityTextFieldMouseClicked // TODO add your handling code here: updateRcmCapacityTextField.setText(""); }//GEN-LAST:event_updateRcmCapacityTextFieldMouseClicked private void updateRcmTotalAmountTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_updateRcmTotalAmountTextFieldMouseClicked // TODO add your handling code here: updateRcmTotalAmountTextField.setText(""); }//GEN-LAST:event_updateRcmTotalAmountTextFieldMouseClicked private void rcmNameTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rcmNameTextFieldMouseClicked // TODO add your handling code here: rcmNameTextField.setText(""); }//GEN-LAST:event_rcmNameTextFieldMouseClicked private void rcmCapacityTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rcmCapacityTextFieldMouseClicked // TODO add your handling code here: rcmCapacityTextField.setText(""); }//GEN-LAST:event_rcmCapacityTextFieldMouseClicked private void updateRcmCapacityTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_updateRcmCapacityTextFieldKeyTyped // TODO add your handling code here: char input = evt.getKeyChar(); validateForInteger(input, evt); }//GEN-LAST:event_updateRcmCapacityTextFieldKeyTyped private void updateRcmTotalAmountTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_updateRcmTotalAmountTextFieldKeyTyped // TODO add your handling code here: char input = evt.getKeyChar(); validateForInteger(input, evt); }//GEN-LAST:event_updateRcmTotalAmountTextFieldKeyTyped private void rcmTotalAmountTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rcmTotalAmountTextFieldMouseClicked // TODO add your handling code here: rcmTotalAmountTextField.setText(""); }//GEN-LAST:event_rcmTotalAmountTextFieldMouseClicked private void rcmTotalAmountTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_rcmTotalAmountTextFieldKeyTyped // TODO add your handling code here: }//GEN-LAST:event_rcmTotalAmountTextFieldKeyTyped private void itemAddPriceWtTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_itemAddPriceWtTextFieldKeyTyped // TODO add your handling code here: char input = evt.getKeyChar(); validateForInteger(input, evt); }//GEN-LAST:event_itemAddPriceWtTextFieldKeyTyped private void itemAddPriceWtTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_itemAddPriceWtTextFieldMouseClicked // TODO add your handling code here: itemAddPriceWtTextField.setText(""); }//GEN-LAST:event_itemAddPriceWtTextFieldMouseClicked private void itemAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemAddButtonActionPerformed // TODO add your handling code here: String itemTypeVal = itemAddTypeTextField.getText(); int price_per_wtVal = Integer.parseInt(itemAddPriceWtTextField.getText()); // if(price_per_wtVal>10) // { // JOptionPane.showMessageDialog(null, "Price per Weight value should be less than $10"); // } // else // { dbconn = new DbConnect(); // try { System.out.println("HERE"); System.out.println(itemTypeVal + " " + price_per_wtVal); dbconn.insertItemType(itemTypeVal, price_per_wtVal); // } catch (SQLException ex) { // Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); // } // } }//GEN-LAST:event_itemAddButtonActionPerformed private void itemAddTypeTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_itemAddTypeTextFieldMouseClicked // TODO add your handling code here: itemAddTypeTextField.setText(""); }//GEN-LAST:event_itemAddTypeTextFieldMouseClicked private void itemUpdatePriceWeighTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_itemUpdatePriceWeighTextFieldMouseClicked // TODO add your handling code here: itemUpdatePriceWeighTextField.setText(""); }//GEN-LAST:event_itemUpdatePriceWeighTextFieldMouseClicked private void itemUpdatePriceWeighTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_itemUpdatePriceWeighTextFieldKeyTyped // TODO add your handling code here: char input = evt.getKeyChar(); validateForInteger(input, evt); }//GEN-LAST:event_itemUpdatePriceWeighTextFieldKeyTyped private void itemUpdateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemUpdateButtonActionPerformed // TODO add your handling code here: dbconn = new DbConnect(); String itemType = itemUpdateTypeComboBox.getSelectedItem().toString(); int priceVal = Integer.parseInt(itemUpdatePriceWeighTextField.getText()); try { dbconn.updateItemType(itemType, priceVal); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_itemUpdateButtonActionPerformed public JCheckBox[] createCheckBoxes() throws SQLException { JCheckBox checkBox[] = { jCheckBox1, jCheckBox2, jCheckBox3, jCheckBox4 }; DbConnect conn = new DbConnect(); ArrayList<String> mylist = new ArrayList<String>(); mylist = conn.fetchItemIds(); System.out.println(mylist.size() + " size length"); for (int i = 0; i < mylist.size(); i++) { // if(i>mylist.size()){ // checkBox[i].setVisible(false); // } else{ checkBox[i].setText(mylist.get(i)); checkBox[i].setVisible(true); // } } return checkBox; } public JCheckBox[] createUpdateCheckBoxes() throws SQLException { JCheckBox checkBox[] = { jCB1, jCB2, jCB3, jCB4 }; DbConnect conn = new DbConnect(); ArrayList<String> mylist = new ArrayList<String>(); mylist = conn.fetchItemIds(); System.out.println(mylist.size() + " size length"); for (int i = 0; i < mylist.size(); i++) { // if(i>mylist.size()){ // checkBox[i].setVisible(false); // } else{ checkBox[i].setText(mylist.get(i)); checkBox[i].setVisible(true); // } } return checkBox; } private void updateRcmButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateRcmButtonActionPerformed // TODO add your handling code here: String rcmName = updateRCMSelectComboBox.getSelectedItem().toString(); int rcmCapacity = Integer.parseInt(updateRcmCapacityTextField.getText()); String rcmLocation = updateRcmLocationComboBox.getSelectedItem().toString(); int rcmTotalAmount = Integer.parseInt(updateRcmTotalAmountTextField.getText()); boolean rcmActivate = updateActivateCheckBox.isSelected(); // System.out.println(rcmTotalAmount+ "BASFASD"); ArrayList<Integer> idArray = new ArrayList<Integer>(5); JCheckBox tempCB[] = { jCB1, jCB2, jCB3 }; if (jCB1.isSelected() || jCB2.isSelected() || jCB3.isSelected()) { for (int i = 0; i < tempCB.length; i++) { if (tempCB[i].isSelected()) { // System.out.println(tempCB[i].getText()); int tempID = 0; try { tempID = getTypeId(tempCB[i].getText()); // System.out.println(tempID); idArray.add(tempID); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } } } // System.out.println("Showing id values "); // for(Integer number: idArray) // { // System.out.println(number); // } // System.out.println(idArray.size()); rcmGuiObj = new Rcm(); dbconn = new DbConnect(); try { int curr_tot_wt = rcmGuiObj.getRcmTotalWeightCapacity(rcmName); int curr_tot_amt = rcmGuiObj.getRcmTotalAmount(rcmName); // if(curr_tot_amt != rcmTotalAmount || curr_tot_wt != rcmCapacity) // { // int selectedOption = JOptionPane.showConfirmDialog(null,"Altering the Capacity or Amount values will result\n in automatic request for servicing the RCM, Do you want to continue","Choose",JOptionPane.YES_NO_OPTION); // if (selectedOption == JOptionPane.YES_OPTION) // { // //Joption // }; // } // // dbconn.updateRcm(rcmName, rcmCapacity, rcmLocation, rcmActivate, idArray, rcmTotalAmount); // dbconn.getRcmRemainingWeightVal(rcmName); // if(curr_rem_amt == ) } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } } else { JOptionPane.showMessageDialog(null, "Atleast one of Plastic/ Aluminium/ Glass needs to be selected"); } }//GEN-LAST:event_updateRcmButtonActionPerformed private int remaining(int current, int portion) { int currVal = current - portion; return currVal; } private void userTypeAdminButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userTypeAdminButtonActionPerformed // TODO add your handling code here: rightPanel.removeAll(); rightPanel.add(loginPanel); rightPanel.repaint(); rightPanel.validate(); userTypeCustomerButton.setEnabled(false); }//GEN-LAST:event_userTypeAdminButtonActionPerformed private void userTypeCustomerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userTypeCustomerButtonActionPerformed // TODO add your handling code here: showHideNavigationPanelButtons(false); rightPanel.removeAll(); rightPanel.add(userTypeRcmPanel); rightPanel.repaint(); rightPanel.validate(); userTypeAdminButton.setEnabled(false); userTypePlaceActionButton.setEnabled(true); startDepositParentPanel.removeAll(); startDepositParentPanel.add(startDepositDefaultPanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); startDepositTotalAmountMessageLabel.setText(""); startDepositTransactionMessageLabel1.setText(""); startDepositWeightMessageLabel.setText(""); startDepositTransactionMessageLabel.setText(""); try { showRcmIdsForCustomerFillCombo(); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_userTypeCustomerButtonActionPerformed private void userTypeIStartButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userTypeIStartButtonActionPerformed // TODO add your handling code here: startDepositTotalAmountMessageLabel.setText(""); startDepositTransactionMessageLabel1.setText(""); startDepositWeightMessageLabel.setText(""); startDepositParentPanel.removeAll(); startDepositParentPanel.add(startDepositPanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); startDepositTransactionMessageLabel.setText(" Please choose a type to recycle. "); String name = userTypeRcmSelectComboBox.getSelectedItem().toString(); String idList = ""; try { idList = showItemTypesForCustomerFillCombo(name); //find query to find the items in the RCM } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } System.out.println("idList :" + idList); // removing the square brackets from string with content in between idList = idList.replaceAll("\\[(.*?)\\]", "$1"); System.out.println("idList a :" + idList); ArrayList<String> idVal = new ArrayList<String>(Arrays.asList(idList.split(","))); for (String id : idVal) { System.out.println("q" + id); } String customerComboBoxValue = ""; try { userTypeItemSelectComboBox.removeAllItems(); for (String id : idVal) { // System.out.println("id :"+id); customerComboBoxValue = findItemTypeNameFromItemTable(id); System.out.println("am here now" + id); System.out.println("In GUI" + customerComboBoxValue); userTypeItemSelectComboBox.addItem(customerComboBoxValue); // userTypePlaceActionButton.setEnabled(true); } } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } // String itemType = userTypeRcmSelectComboBox.getSelectedItem(); }//GEN-LAST:event_userTypeIStartButtonActionPerformed private void userTypeItemSelectComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userTypeItemSelectComboBoxActionPerformed // TODO add your handling code here: // userTypeIMessagePrompt.setText(" Please Place the item to be recycled in the Item Slot"); }//GEN-LAST:event_userTypeItemSelectComboBoxActionPerformed // private void setWeight(int newWeight) { weight = newWeight; } private int getWeight() { return weight; } private void userTypePlaceActionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userTypePlaceActionButtonActionPerformed // TODO add your handling code here: dbconn = new DbConnect(); weight = fetchRandomWeight(1, 10); setWeight(weight); startDepositTransactionMessageLabel.setText(" Please wait while we calculate the weight of the item "); String rcmName = userTypeRcmSelectComboBox.getSelectedItem().toString(); int rcmID = 0; int remainingAmount = 0; int remainingWeight = 0; String name = userTypeItemSelectComboBox.getSelectedItem().toString(); name = name.replaceAll("\\((.*?)\\)", "$1"); // // System.out.println("here"+name); name = name.replaceFirst(".*?(\\d+).*", "$1"); // // System.out.println("here"+name); int price = Integer.parseInt(name); setPrice(price); try { rcmID = fetchRcmIdforTransaction(rcmName); // System.out.println("****here***"+rcmID); remainingWeight = dbconn.getRcmRemainingWeightVal(rcmName); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } startDepositTransactionMessageLabel.setText(""); startDepositWeightMessageLabel.setText("The item you entered is " + weight + " Lbs."); // startDepositTransactionMessageLabel.setText(" Capacity full. Deposit cannot be processed."); // startDepositTransactionMessageLabel1.setText(" Please try again later."); //JOptionPane.showMessageDialog(null, "rem wt : "+remainingWeight+"weight:"+weight); if (remainingWeight < 1) { startDepositTransactionMessageLabel.setText(" Capacity full. Deposit cannot be processed."); startDepositTransactionMessageLabel1.setText(" Please try again later."); startDepositParentPanel.removeAll(); startDepositParentPanel.add(startDepositDefaultPanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); } else if (remainingWeight < weight) { startDepositTransactionMessageLabel.setText(" Capacity full. Deposit cannot be processed."); startDepositTransactionMessageLabel1.setText(" Please try again later."); startDepositParentPanel.removeAll(); startDepositParentPanel.add(startDepositDefaultPanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); } else {// coupon cash panel should show up here startDepositParentPanel.removeAll(); startDepositParentPanel.add(paymentTypePanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); // startDepositTransactionMessageLabel1.setText(""); // startDepositTransactionMessageLabel.setText(" Please wait while we calculate"); // String name = userTypeItemSelectComboBox.getSelectedItem().toString(); // name = name.replaceAll("\\((.*?)\\)", "$1"); // // System.out.println("here"+name); // name = name.replaceFirst(".*?(\\d+).*", "$1"); // // System.out.println("here"+name); // int price = Integer.parseInt(name); // // // // // String temp = rcmName.replaceAll(".*?(\\d+).*", "$1"); // // System.out.println(temp); // // // try // // { // // Thread.sleep(3000); // // } // // catch (InterruptedException ex) // // { // // Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); // // } // // userTypeIMessagePrompt.removeAll(); // int total_amount = calculateAmount(weight, price); // int remainingAmountVal=0; // try { // remainingAmountVal = dbconn.getRcmRemainingAmountVal(rcmName); // JOptionPane.showMessageDialog(null, " asdv :"+remainingAmountVal); // } catch (SQLException ex) { // Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); // } // if(remainingAmountVal < 1 ) //|| // { // startDepositTransactionMessageLabel.setText(" Insufficient funds."); //// startDepositTransactionMessageLabel1.setText(" Please try again later."); // startDepositTotalAmountMessageLabel.setText("Please Collect coupons worth $"+total_amount+" from the money slot"); // } // else if(remainingAmountVal<=total_amount) // { // startDepositTransactionMessageLabel.setText(" Insufficient funds."); //// startDepositTransactionMessageLabel1.setText(" Please try again later."); // startDepositTotalAmountMessageLabel.setText("Please Collect coupons worth $"+total_amount+" from the money slot"); // } // else // { // startDepositTotalAmountMessageLabel.setText("Please Collect $"+total_amount+" from the money slot"); // String itemTypeandPrice = userTypeItemSelectComboBox.getSelectedItem().toString(); // // String getPriceFromString = itemTypeandPrice.replaceAll("\\((.*?)\\)", "$1").replaceFirst(".*?(\\d+).*", "$1"); // System.out.println("price:"+price+" weight:"+weight); // String getItemNameFromString = itemTypeandPrice.replaceAll("\\((.*?)\\)", "$1"); // getItemNameFromString =getItemNameFromString.substring(0, getItemNameFromString.indexOf('$')); // getItemNameFromString = getItemNameFromString.replaceAll("\\s", ""); // // int itemIdVal=0; // try { // // System.out.println(getItemNameFromString+"."); // // JOptionPane.showMessageDialog(null, getItemNameFromString); // // itemIdVal = getTypeId(getItemNameFromString); // System.out.println(itemIdVal+rcmName); // // Date dateValue = new Date() // // DateFormat dFormat; // // // Date date = new Date(); // // DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); // // String dateVal= dateFormatter.format(date); // // System.out.println("rcm id :"+rcmID+ " itemId:"+itemIdVal+" weight:"+weight+" price:"+price+" date:"+dateVal); // // // // // Update the rcm table with new remaining amount and remaing capacity // int new_rem_amount= remaining(remainingAmountVal, total_amount); // int new_rem_capacity= remaining(remainingWeight, weight); // System.out.println("BWAHAHA name:"+rcmName+" total_amount:"+total_amount+" rem_amount:"+new_rem_amount+" rem cap:"+new_rem_capacity+" amount due:"+total_amount); // dbconn.setRemainingAmount(new_rem_amount, rcmName); // dbconn.setRemainingCapacity(new_rem_capacity, rcmName); // // // // JOptionPane.showMessageDialog(null, total_amount); // // insertTransaction(rcmID, itemIdVal, weight, price); // } catch (SQLException ex) { // Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); // } // } // userTypeIMessagePrompt.setText(" Please collect $"+total_amount+" from the money slot"); // userTypeIMessagePrompt.repaint(); // userTypeIMessagePrompt.revalidate(); // startDepositTotalAmountMessageLabel.setText("Please Collect $"+total_amount+" from the money slot"); // } // // // JOptionPane.showMessageDialog(null, itemTypeandPrice); //Fetching only the integer value from the Strign // // JOptionPane.showMessageDialog(null, getPriceFromString); // String getItemNameFromString = itemTypeandPrice.replaceAll("\\((.*?)\\)", "$1"); // System.out.println(getItemNameFromString); // userTypePlaceActionButton.setEnabled(false); // // // startDepositParentPanel.removeAll(); // startDepositParentPanel.add(startDepositDefaultPanel); // startDepositParentPanel.repaint(); // startDepositParentPanel.validate(); }//GEN-LAST:event_userTypePlaceActionButtonActionPerformed // ArrayList<Integer> fetchItemIdsFromRcmTable(String name) throws SQLException // { // dbconn = new DbConnect(); //// ArrayList<Integer> id1 = dbconn.getItemIdsFromRcmTable(name); // return id1; // } private float fetchTypePrice(String nameVal) throws SQLException { dbconn = new DbConnect(); return dbconn.getItemPrice(nameVal); } /** * calculate the price of the entered item * @param wt * @return */ private int calculateAmount(int wt, int price) { System.out.println(" " + wt + " " + price); int amount = price * wt; return amount; } private void userTypeItemSelectComboBoxMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_userTypeItemSelectComboBoxMouseReleased // TODO add your handling code here: // userTypeIMessagePrompt.setText(" Please Place the item to be recycled in the Item Slot"); startDepositTransactionMessageLabel.setText(" Place the item to recycle in the item slot"); }//GEN-LAST:event_userTypeItemSelectComboBoxMouseReleased private void userTypeIExitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userTypeIExitButtonActionPerformed // TODO add your handling code here: rightPanel.removeAll(); rightPanel.add(welcomePanel); rightPanel.repaint(); rightPanel.validate(); userTypeAdminButton.setEnabled(true); }//GEN-LAST:event_userTypeIExitButtonActionPerformed private void loginExitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginExitButtonActionPerformed // TODO add your handling code here: showHideNavigationPanelButtons(false); userTypeCustomerButton.setEnabled(true); rightPanel.removeAll(); rightPanel.add(welcomePanel); rightPanel.repaint(); rightPanel.validate(); }//GEN-LAST:event_loginExitButtonActionPerformed private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed // TODO add your handling code here: String user_name = userNameTextField.getText(); String password = passwordTextField.getText(); userTypeCustomerButton.setEnabled(false); try { Boolean isValidValue = true; isValidValue = adminValid(user_name, password); if (isValidValue) { // enable all the admin buttons showHideNavigationPanelButtons(true); //show new panel actionCompleteMessagePanel rightPanel.removeAll(); rightPanel.add(actionCompleteMessagePanel); rightPanel.repaint(); rightPanel.validate(); actionCompleteMessageLabel.removeAll(); actionCompleteMessageLabel.setText(" Welcome " + user_name.toUpperCase()); userTypeAdminButton.setEnabled(false); exitAdminButton.setEnabled(true); // } } else { } } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } }//GEN-LAST:event_loginButtonActionPerformed private void exitAdminButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitAdminButtonActionPerformed // TODO add your handling code here: //add table to the panel rightPanel.removeAll(); rightPanel.add(welcomePanel); rightPanel.repaint(); rightPanel.validate(); userTypeAdminButton.setEnabled(true); userTypeCustomerButton.setEnabled(true); exitAdminButton.setEnabled(false); showHideNavigationPanelButtons(false); }//GEN-LAST:event_exitAdminButtonActionPerformed private void serviceNowRcmSelectionComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_serviceNowRcmSelectionComboBoxActionPerformed // TODO add your handling code here: }//GEN-LAST:event_serviceNowRcmSelectionComboBoxActionPerformed private void updateRCMSelectComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateRCMSelectComboBoxActionPerformed // TODO add your handling code here: }//GEN-LAST:event_updateRCMSelectComboBoxActionPerformed private void updateRCMSelectComboBoxMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_updateRCMSelectComboBoxMouseReleased // TODO add your handling code here: rcmGuiObj = new Rcm(); String name = updateRCMSelectComboBox.getSelectedItem().toString(); try { int total_weight = dbconn.findTotalWeight(name);//rcmGuiObj.getRcmTotalWeightCapacity(name); int total_amount = dbconn.findTotalAmount(name); String temp = String.valueOf(total_weight); updateRcmCapacityTextField.setText(temp); // temp = String.valueOf(total_amount); updateRcmTotalAmountTextField.setText(temp); boolean active = dbconn.activationInfo(name); updateActivateCheckBox.setSelected(active); String locVal = dbconn.findLocation(name); updateRcmLocationComboBox.setSelectedItem(locVal); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } }//GEN-LAST:event_updateRCMSelectComboBoxMouseReleased private void serviceCapacityButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_serviceCapacityButtonActionPerformed // TODO add your handling code here: // on click this button should update the capacity to total capacity emptyRefilMessageLabel.setText(" Items have been emptied "); String rcmName = serviceNowRcmSelectionComboBox.getSelectedItem().toString(); dbconn = new DbConnect(); try { dbconn.emptyCapacityAction(rcmName); //call the function that queries serviceCapacityButton.setEnabled(false); int id = dbconn.findRcm(rcmName); Date date = new Date(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String dateString = df.format(date); dbconn.setLastServiceDate(id, dateString); System.out.println("try"); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_serviceCapacityButtonActionPerformed private void serviceAmountButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_serviceAmountButtonActionPerformed // TODO add your handling code here: emptyRefilMessageLabel.setText(" Funds have been refilled"); String rcmName = serviceNowRcmSelectionComboBox.getSelectedItem().toString(); dbconn = new DbConnect(); try { dbconn.refillAmountAction(rcmName); serviceAmountButton.setEnabled(false); int id = dbconn.findRcm(rcmName); Date date = new Date(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String dateString = df.format(date); dbconn.setLastServiceDate(id, dateString); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } }//GEN-LAST:event_serviceAmountButtonActionPerformed private void serviceNowRcmSelectionComboBoxMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_serviceNowRcmSelectionComboBoxMouseReleased // TODO add your handling code here: //Display details of the rcm rcmStatCurrentTotalCapacityLabel.setText(""); rcmStatNameLabel.setText(""); rcmStatTotalAmountLabel.setText(""); rcmStatCurrentTotalAmountLabel.setText(""); rcmStatTotalCapacityLabel.setText(""); rcmStatLastServicedLabel.setText(""); // rcmNameLabel.setText(""); emptyRefilMessageLabel.setText(""); String rcmName = serviceNowRcmSelectionComboBox.getSelectedItem().toString(); if (rcmName == "Select a RCM") { serviceRcmSelectionErrorLabel.removeAll(); serviceRcmSelectionErrorLabel.setText("ERROR : RCM not Sellected "); } else { serviceParentPanel.removeAll(); serviceParentPanel.add(serviceChildPanel); serviceParentPanel.repaint(); serviceParentPanel.validate(); serviceCapacityButton.setEnabled(false); serviceAmountButton.setEnabled(false); serviceRcmSelectionErrorLabel.removeAll(); serviceRcmSelectionErrorLabel.setText(""); rcmStatNameLabel.removeAll(); ; rcmStatNameLabel.setText("Displaying details for " + rcmName + ":"); int total_weight = 0; int remaining_weight = 0; int remaining_amount = 0; int total_amount = 0; String dateValue = ""; try { dbconn = new DbConnect(); total_weight = dbconn.findTotalWeight(rcmName); int id = dbconn.findRcm(rcmName); dateValue = dbconn.getServiceDate(id); // System.out.println("cap: "+total_weight); rcmStatTotalCapacityLabel.removeAll(); rcmStatTotalCapacityLabel.setText("Total Capacity : " + total_weight); total_amount = dbconn.findTotalAmount(rcmName); rcmStatTotalAmountLabel.removeAll(); rcmStatTotalAmountLabel.setText("Total Amount : " + total_amount); remaining_weight = dbconn.getRcmRemainingWeightVal(rcmName); remaining_amount = dbconn.getRcmRemainingAmountVal(rcmName); rcmStatCurrentTotalAmountLabel.setText("Remaining Amount Reserve : " + remaining_amount); rcmStatCurrentTotalCapacityLabel.setText("Remaining capacity : " + remaining_weight); rcmStatLastServicedLabel.setText("Last date of service : " + dateValue); if (remaining_weight <= 100 && remaining_amount <= 100) { serviceCapacityButton.setEnabled(true); serviceAmountButton.setEnabled(true); } else if (remaining_weight <= 100) { serviceCapacityButton.setEnabled(true); } else if (remaining_amount <= 100) { serviceAmountButton.setEnabled(true); } else { serviceCapacityButton.setEnabled(false); serviceAmountButton.setEnabled(false); } } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } } }//GEN-LAST:event_serviceNowRcmSelectionComboBoxMouseReleased private void paymentMethodCashButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_paymentMethodCashButtonActionPerformed // TODO add your handling code here: //code for cash payment String rcmName = userTypeRcmSelectComboBox.getSelectedItem().toString(); String weightString = startDepositWeightMessageLabel.getText(); weightString = weightString.replaceFirst(".*?(\\d+).*", "$1"); int weight = Integer.parseInt(weightString); int rcmID = 0; int remainingWeight = 0; // JOptionPane.showMessageDialog(null, weightString); startDepositTransactionMessageLabel1.setText(""); startDepositTransactionMessageLabel.setText(" Please wait while we calculate"); String name = userTypeItemSelectComboBox.getSelectedItem().toString(); name = name.replaceAll("\\((.*?)\\)", "$1"); // System.out.println("here"+name); name = name.replaceFirst(".*?(\\d+).*", "$1"); // System.out.println("here"+name); int price = Integer.parseInt(name); // // String temp = rcmName.replaceAll(".*?(\\d+).*", "$1"); // System.out.println(temp); // try // { // Thread.sleep(3000); // } // catch (InterruptedException ex) // { // Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); // } // userTypeIMessagePrompt.removeAll(); int total_amount = calculateAmount(weight, price); // setPrice(total_amount); int remainingAmountVal = 0; try { remainingWeight = dbconn.getRcmRemainingWeightVal(rcmName); remainingAmountVal = dbconn.getRcmRemainingAmountVal(rcmName); rcmID = fetchRcmIdforTransaction(rcmName); // JOptionPane.showMessageDialog(null, " asdv :"+remainingAmountVal); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } if (remainingAmountVal < 1) //|| { startDepositTransactionMessageLabel.setText(" Insufficient funds."); // startDepositTransactionMessageLabel1.setText(" Please try again later."); startDepositTotalAmountMessageLabel .setText("Please Collect coupons worth $" + total_amount + " from the money slot"); } else if (remainingAmountVal <= total_amount) { startDepositTransactionMessageLabel.setText(" Insufficient funds."); // startDepositTransactionMessageLabel1.setText(" Please try again later."); startDepositTotalAmountMessageLabel .setText("Please Collect coupons worth $" + total_amount + " from the money slot"); } else { startDepositTotalAmountMessageLabel.setText("Please Collect $" + total_amount + " from the money slot"); String itemTypeandPrice = userTypeItemSelectComboBox.getSelectedItem().toString(); // String getPriceFromString = itemTypeandPrice.replaceAll("\\((.*?)\\)", "$1").replaceFirst(".*?(\\d+).*", "$1"); // System.out.println("price:"+price+" weight:"+weight); String getItemNameFromString = itemTypeandPrice.replaceAll("\\((.*?)\\)", "$1"); getItemNameFromString = getItemNameFromString.substring(0, getItemNameFromString.indexOf('$')); getItemNameFromString = getItemNameFromString.replaceAll("\\s", ""); int itemIdVal = 0; try { // System.out.println(getItemNameFromString+"."); // JOptionPane.showMessageDialog(null, getItemNameFromString); itemIdVal = getTypeId(getItemNameFromString); System.out.println(itemIdVal + rcmName); // Date dateValue = new Date() // DateFormat dFormat; // Date date = new Date(); // DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); // String dateVal= dateFormatter.format(date); // System.out.println("rcm id :"+rcmID+ " itemId:"+itemIdVal+" weight:"+weight+" price:"+price+" date:"+dateVal); // Update the rcm table with new remaining amount and remaing capacity int new_rem_amount = remaining(remainingAmountVal, total_amount); int new_rem_capacity = remaining(remainingWeight, weight); System.out.println("BWAHAHA name:" + rcmName + " total_amount:" + total_amount + " rem_amount:" + new_rem_amount + " rem cap:" + new_rem_capacity + " amount due:" + total_amount); dbconn.setRemainingAmount(new_rem_amount, rcmName); dbconn.setRemainingCapacity(new_rem_capacity, rcmName); // startDepositTotalAmountMessageLabel.setText(" Please collect ") // JOptionPane.showMessageDialog(null, total_amount); insertTransaction(rcmID, itemIdVal, weight, price); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } } // userTypeIMessagePrompt.setText(" Please collect $"+total_amount+" from the money slot"); // userTypeIMessagePrompt.repaint(); // userTypeIMessagePrompt.revalidate(); // startDepositTotalAmountMessageLabel.setText("Please Collect $"+total_amount+" from the money slot"); startDepositParentPanel.removeAll(); startDepositParentPanel.add(metricTypePanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); // }//GEN-LAST:event_paymentMethodCashButtonActionPerformed private void yesMetricButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yesMetricButtonActionPerformed // TODO add your handling code here: String weightString = startDepositWeightMessageLabel.getText(); weightString = weightString.replaceFirst(".*?(\\d+).*", "$1"); int weight = Integer.parseInt(weightString); double kgs = weight * .453; // startDepositWeightMessageLabel startDepositWeightMessageLabel.setText("Weight is " + kgs + " Kgs"); startDepositParentPanel.removeAll(); startDepositParentPanel.add(startDepositDefaultPanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); }//GEN-LAST:event_yesMetricButtonActionPerformed private void noMetricButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noMetricButtonActionPerformed // TODO add your handling code here: startDepositParentPanel.removeAll(); startDepositParentPanel.add(startDepositDefaultPanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); }//GEN-LAST:event_noMetricButtonActionPerformed private void paymentMethodCouponButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_paymentMethodCouponButtonActionPerformed // TODO add your handling code here: String name = userTypeItemSelectComboBox.getSelectedItem().toString(); int weight = getWeight(); int price = getPrice(); int remainingWeight = 0; try { remainingWeight = dbconn.getRcmRemainingWeightVal(name); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } int new_rem_capacity = remaining(remainingWeight, weight); int total_amount = calculateAmount(weight, price); startDepositTotalAmountMessageLabel .setText("Please Collect coupons worth $" + total_amount + " from the money slot"); startDepositParentPanel.removeAll(); startDepositParentPanel.add(metricTypePanel); startDepositParentPanel.repaint(); startDepositParentPanel.validate(); }//GEN-LAST:event_paymentMethodCouponButtonActionPerformed private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed // TODO add your handling code here: rightPanel.removeAll(); rightPanel.add(deleteRcmPanel); rightPanel.repaint(); rightPanel.validate(); deleteRcmSelectionComboBox.removeAllItems(); try { valueForFillCombo(); // ar = createUpdateCheckBoxes(); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_deleteButtonActionPerformed private void deleteRcmButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteRcmButtonActionPerformed // TODO add your handling code here: String name = deleteRcmSelectionComboBox.getSelectedItem().toString(); dbconn = new DbConnect(); try { dbconn.deleteRcmAction(name); } catch (SQLException ex) { Logger.getLogger(RmosGUI.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_deleteRcmButtonActionPerformed public static int fetchRandomWeight(int min, int max) { Random rand = new Random(); int randomNum = rand.nextInt((max - min) + 1) + min; return randomNum; } private int getTypeId(String type) throws SQLException { dbconn = new DbConnect(); int id = dbconn.getItemTypeID(type); // System.out.println(id); return id; } /** * to insert into RCM * ->> to go inside RCM class * @param id * @param name * @param capacity * @param location * @param amount */ private void insertRcm(ArrayList<Integer> id, String name, int capacity, String location, int amount) //throws SQLException { dbconn = new DbConnect(); dbconn.insertRCM(id, name, capacity, location, amount); } private void validateForInteger(char input, java.awt.event.KeyEvent e) { if (!(Character.isDigit(input)) || (input == KeyEvent.VK_BACK_SPACE) || (input == KeyEvent.VK_DELETE)) { getToolkit().beep(); e.consume(); } } void valueForFillCombo() throws SQLException { ArrayList<String> val = new ArrayList<String>(5); dbconn = new DbConnect(); // val = dbconn.nameValueForFillCombo(); // updateRCMSelectComboBox.removeAllItems(); ; for (String name : val) { System.out.println("Here"); System.out.println(name); // String temp = "'" + name + "'"; // deleteRcmSelectionComboBox.addItem(name); updateRCMSelectComboBox.addItem(name); } // } private void setPrice(int newPrice) { price = newPrice; } private int getPrice() { return price; } // fetch idividual RCM ID for transactions int fetchRcmIdforTransaction(String rcmName) throws SQLException { dbconn = new DbConnect(); int rcmId = dbconn.fetchRcmIdfromRcmTable(rcmName); return rcmId; } /** * populate the RCM ids for combobox of the customer RCM panel * @throws SQLException */ void showRcmIdsForCustomerFillCombo() throws SQLException { ArrayList<String> val = new ArrayList<String>(5); dbconn = new DbConnect(); // val = dbconn.nameValueForFillCombo(); // userTypeRcmSelectComboBox.removeAllItems(); ; for (String name : val) { // System.out.println("Here"); // System.out.println(name); // // String temp = "'"+name+"'"; // userTypeRcmSelectComboBox.addItem(name); } } //show rcmid for swervice now void showRcmIdsForServiceFillCombo() throws SQLException { ArrayList<String> val = new ArrayList<String>(5); dbconn = new DbConnect(); // val = dbconn.nameValueForFillCombo(); // userTypeRcmSelectComboBox.removeAllItems(); serviceNowRcmSelectionComboBox.removeAllItems(); for (String name : val) { // System.out.println("Here"); // System.out.println(name); // // String temp = "'"+name+"'"; // serviceNowRcmSelectionComboBox.addItem(name); } } String findItemTypeNameFromItemTable(String itemId) throws SQLException { dbconn = new DbConnect(); String itemNameAndStringValue = dbconn.fetchItemTypeAndName(itemId); // System.out.println(itemNameAndStringValue); return itemNameAndStringValue; } /** * Fill recyclable type values for combo box in Item Update Panel * @throws SQLException */ void fillTypeComboBox() throws SQLException { ArrayList<String> val = new ArrayList<String>(5); dbconn = new DbConnect(); // System.out.println("Showing type values from Dbconn "); // ArrayList<String> val = new ArrayList<String>(5); val = dbconn.typeValueForFillCombo(); // for(String number: val) // { // System.out.println("LOL"); // System.out.println(number); // } // System.out.println(idVal.size()); itemUpdateTypeComboBox.removeAllItems(); ; for (String name : val) { // System.out.println("Here"); // System.out.println(name); // String temp = "'"+name+"'"; { itemUpdateTypeComboBox.addItem(name); } } // } /** * populate the recyclable item types for combo box for Customer Panel * @throws SQLException */ private String showItemTypesForCustomerFillCombo(String itemName) throws SQLException { dbconn = new DbConnect(); // fetching the item ids from the rcm table String val = dbconn.getItemTypeIdFromRcmTable(itemName); System.out.println(val); // System.out.println("Showing type values from Dbconn "); // ArrayList<String> val = new ArrayList<String>(5); // val = dbconn.typeValueForFillCombo(); // for(String number: val) // { // System.out.println("LOL"); // System.out.println(number); // } // System.out.println(idVal.size()); // userTypeItemSelectComboBox.removeAllItems();; // for(int name: val) // { // System.out.println("Here"); // System.out.println(name); // // String temp = "'"+name+"'"; // // { // userTypeItemSelectComboBox.addItem(name); // } // } // return val; } public void showHideNavigationPanelButtons(Boolean val) { btnAddRCM.setEnabled(val); btnUpdateRCM.setEnabled(val); btnAddItem.setEnabled(val); btnUpdateItem.setEnabled(val); // btnRemoveItem.setEnabled(val);; btnServiceNow.setEnabled(val); // btnServiceUpdate.setEnabled(val); btnShowStat.setEnabled(val); deleteButton.setEnabled(val); } Boolean adminValid(String name, String password) throws SQLException { dbconn = new DbConnect(); Boolean valid = dbconn.adminValidation(name, password); return valid; } private void insertTransaction(int rcmId, int itemId, int weight, int price) throws SQLException { dbconn = new DbConnect(); int amount = calculateAmount(weight, price); dbconn.insertIntoTransactionTable(rcmId, itemId, weight, amount); } private void checkBoxVisibility(Boolean val) { jCheckBox1.setVisible(val); jCheckBox2.setVisible(val); jCheckBox3.setVisible(val); jCheckBox4.setVisible(val); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(RmosGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(RmosGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(RmosGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(RmosGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new RmosGUI().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel ServiceBlankPanel; private javax.swing.JLabel WelcomePicTable; private javax.swing.JLabel actionCompleteMessageLabel; private javax.swing.JPanel actionCompleteMessagePanel; private javax.swing.JPanel addRCMPanel; private javax.swing.JButton btnAddItem; private javax.swing.JButton btnAddRCM; private javax.swing.JButton btnServiceNow; private javax.swing.JButton btnShowStat; private javax.swing.JButton btnUpdateItem; private javax.swing.JButton btnUpdateRCM; private javax.swing.JButton deleteButton; private javax.swing.JButton deleteRcmButton; private javax.swing.JPanel deleteRcmPanel; private javax.swing.JComboBox<String> deleteRcmSelectionComboBox; private javax.swing.JLabel emptyRefilMessageLabel; private javax.swing.JButton exitAdminButton; private javax.swing.JLabel iconLabel; private javax.swing.JButton itemAddButton; private javax.swing.JPanel itemAddPanel; private javax.swing.JLabel itemAddPriceWeightLabel; private javax.swing.JTextField itemAddPriceWtTextField; private javax.swing.JLabel itemAddTypeLabel; private javax.swing.JTextField itemAddTypeTextField; private javax.swing.JPanel itemButtonPanel; private javax.swing.JButton itemRemoveButton; private javax.swing.JPanel itemRemovePanel; private javax.swing.JLabel itemRemovePriceWeightLabel; private javax.swing.JLabel itemRemoveRecycTypLabel; private javax.swing.JTextField itemRemoveTextField; private javax.swing.JComboBox<String> itemRemoveTypeComboBox; private javax.swing.JButton itemUpdateButton; private javax.swing.JPanel itemUpdatePanel; private javax.swing.JTextField itemUpdatePriceWeighTextField; private javax.swing.JLabel itemUpdatePriceWeightLabel; private javax.swing.JLabel itemUpdateRecycTypLabel; private javax.swing.JComboBox<String> itemUpdateTypeComboBox; private javax.swing.JCheckBox jCB1; private javax.swing.JCheckBox jCB2; private javax.swing.JCheckBox jCB3; private javax.swing.JCheckBox jCB4; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JCheckBox jCheckBox2; private javax.swing.JCheckBox jCheckBox3; private javax.swing.JCheckBox jCheckBox4; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel leftLowerPanel; private javax.swing.JPanel leftPanel; private javax.swing.JPanel leftUpperPanel; private javax.swing.JPanel listRCMPanel; private javax.swing.JButton loginButton; private javax.swing.JButton loginExitButton; private javax.swing.JPanel loginPanel; private javax.swing.JPanel mainFramePanel; private javax.swing.JLabel metricMessageLabel; private javax.swing.JPanel metricTypePanel; private javax.swing.JButton noMetricButton; private javax.swing.JLabel passwordLabel; private javax.swing.JTextField passwordTextField; private javax.swing.JButton paymentMethodCashButton; private javax.swing.JButton paymentMethodCouponButton; private javax.swing.JLabel paymentTypeMessagePanel; private javax.swing.JPanel paymentTypePanel; private javax.swing.JButton rcmAddButton; private javax.swing.JPanel rcmButtonPanel; private javax.swing.JLabel rcmCapacityLabel; private javax.swing.JTextField rcmCapacityTextField; private javax.swing.JPanel rcmItemListPanel; private javax.swing.JPanel rcmItemListPanel1; private javax.swing.JLabel rcmLabel; private javax.swing.JComboBox<String> rcmLocationComboBox; private javax.swing.JLabel rcmLocationLabel; private javax.swing.JLabel rcmNameLabel; private javax.swing.JTextField rcmNameTextField; private javax.swing.JLabel rcmStatCurrentTotalAmountLabel; private javax.swing.JLabel rcmStatCurrentTotalCapacityLabel; private javax.swing.JPanel rcmStatDisplayPanel; private javax.swing.JLabel rcmStatLastServicedLabel; private javax.swing.JLabel rcmStatNameLabel; private javax.swing.JLabel rcmStatTotalAmountLabel; private javax.swing.JLabel rcmStatTotalCapacityLabel; private javax.swing.JLabel rcmTotalAmountLabel; private javax.swing.JTextField rcmTotalAmountTextField; private javax.swing.JPanel rightPanel; private javax.swing.JButton serviceAmountButton; private javax.swing.JPanel serviceButtonPanel; private javax.swing.JButton serviceCapacityButton; private javax.swing.JPanel serviceChildPanel; private javax.swing.JComboBox<String> serviceNowRcmSelectionComboBox; private javax.swing.JPanel servicePanel; private javax.swing.JPanel serviceParentPanel; private javax.swing.JLabel serviceRcmSelectionErrorLabel; private javax.swing.JPanel serviceUpdatePanel; private javax.swing.JPanel showStatPanel; private javax.swing.JPanel startDepositDefaultPanel; private javax.swing.JPanel startDepositPanel; private javax.swing.JPanel startDepositParentPanel; private javax.swing.JLabel startDepositTotalAmountMessageLabel; private javax.swing.JLabel startDepositTransactionMessageLabel; private javax.swing.JLabel startDepositTransactionMessageLabel1; private javax.swing.JLabel startDepositWeightMessageLabel; private javax.swing.JPanel statButtonPanel; private javax.swing.JCheckBox updateActivateCheckBox; private javax.swing.JPanel updateRCMPanel; private javax.swing.JComboBox<String> updateRCMSelectComboBox; private javax.swing.JButton updateRcmButton; private javax.swing.JLabel updateRcmCapacityLabel; private javax.swing.JTextField updateRcmCapacityTextField; private javax.swing.JLabel updateRcmLabel; private javax.swing.JComboBox<String> updateRcmLocationComboBox; private javax.swing.JLabel updateRcmLocationLabel; private javax.swing.JLabel updateRcmTotalAmountLabel; private javax.swing.JTextField updateRcmTotalAmountTextField; private javax.swing.JLabel userNameLabel; private javax.swing.JTextField userNameTextField; private javax.swing.JButton userTypeAdminButton; private javax.swing.JButton userTypeCustomerButton; private javax.swing.JButton userTypeIExitButton; private javax.swing.JButton userTypeIStartButton; private javax.swing.JComboBox<String> userTypeItemSelectComboBox; private javax.swing.JLabel userTypeItemSelectLabel; private javax.swing.JPanel userTypePanel; private javax.swing.JButton userTypePlaceActionButton; private javax.swing.JPanel userTypeRcmPanel; private javax.swing.JComboBox<String> userTypeRcmSelectComboBox; private javax.swing.JLabel userTypeRcmSelectLabel; private javax.swing.JPanel welcomePanel; private javax.swing.JButton yesMetricButton; // End of variables declaration//GEN-END:variables }