private void addToCartMouseClicked(java.awt.event.MouseEvent evt) {

        // -- {{ What happens when you press the "ADD TO CART" button }} --

    	String preiid, prequantity;
        int iid = 0;
        int quantity = 0;

        preiid = enterItemUPC.getText();
        prequantity = enterItemQuan.getText();

        // Checks to see if one of the Item UPC or Quantity fields are blank
        if (preiid.length() == 0 || prequantity.length() == 0) {
        	// Error message
    		JOptionPane.showMessageDialog(null, "Both Item UPC and Quantity fields must be filled.",
    				"Inane error",
    				JOptionPane.ERROR_MESSAGE);
    		isValid.setText("Invalid");

    		//All is well
        } else {

        	//grabs item_upc and item_quantity from the text field that the user enters.
        	try {
        		iid = Integer.parseInt(enterItemUPC.getText());
        		quantity = Integer.parseInt(enterItemQuan.getText());
        	} catch (NumberFormatException e) {
        		displayMessage("Get it together, that's not a number.");
        		enterItemUPC.setText("");
        		enterItemQuan.setText("");
        		return;
        	}

        }
        
        try {
            if (newPurchase) {
                trans.insertNewPurchase();
                newPurchase = false;
            }
            if (trans.addToCart(iid, quantity)) {
            	Statement stmt = con.createStatement();
            	ResultSet rs = stmt.executeQuery("SELECT item_price FROM Item WHERE item_upc = " + iid);
            	if (rs.next()) {
            		dollars += quantity * rs.getDouble("item_price");
                	total.setText(String.valueOf(dollars));
                	System.out.println("DOLLARS:" + dollars);
            	}
            }

        } catch (SQLException e) {
        	// TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 

    }