Java

Restaurant Simple Pos in Java

The Restaurant Simple Pos is developed using Java. The project is built to manage sales and transactions. To make a new transaction, fields such as: Item type with ingredients, qty needs to be selected. If you like to learn point of sales systems step by step, this is the right place to learn from the beginning. In this tutorial useful for making a point of sales system for a small shops.

The system shall be able to select the relevant Item type with Ingredients type.

Creating variable

String item;
String ind;
int i = 0;

Paste the code inside the addbutton

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         

        if(txtqty.getText().isEmpty())
        {
            JOptionPane.showMessageDialog(this, "Please Enter the Qty");
        }
        else
        {
            if(lblroll.isSelected() == true  )
            {
                item = "Roll";
                if(lblveg.isSelected() == true)
                {
                    i = 12;
                    ind = lblveg.getText();
                }
                else if(lblfish.isSelected() == true)
                {
                    i = 20;
                    ind = lblfish.getText();
                }
                else if(lblchicken.isSelected() == true)
                {
                    i = 25;
                    ind = lblchicken.getText();
                }
            }
            else if(lblbun.isSelected() == true  )
            {
                item = "Bun";
                if(lblveg.isSelected() == true)
                {
                    i = 20;
                    ind = "Veg";
                }
                else if(lblfish.isSelected() == true)
                {
                    i = 25;
                    ind = "Fish";
                }
                else if(lblchicken.isSelected() == true)
                {
                    i = 28;
                    ind = "Chicken";
                }
            }
            else if(lblpasty.isSelected() == true  )
            {
                item = "Pasty";
                if(lblveg.isSelected() == true)
                {
                    i = 30;
                    ind = "Veg";
                }
                else if(lblfish.isSelected() == true)
                {
                    i = 35;
                    ind = "Fish";
                }
                else if(lblchicken.isSelected() == true)
                {
                    i = 38;
                    ind = "Chicken";
                }

            }
            int qty = Integer.parseInt(txtqty.getText());
            int tot = qty * i;
            txttotal.setText(String.valueOf(tot));
            model = (DefaultTableModel)jTable1.getModel();
            model.addRow(new Object[]
                {
                    item + " " + ind,
                    i,
                    txtqty.getText(),
                    txttotal.getText(),

                });

                int sum=0;
                for(int a=0; a<jTable1.getRowCount(); a++)
                {
                    sum = sum + Integer.parseInt(jTable1.getValueAt(a, 3).toString());
                }
                jLabel4.setText(Integer.toString(sum));
                lblroll.setSelected(false);
                lblbun.setSelected(false);
                lblpasty.setSelected(false);
                lblveg.setSelected(false);
                lblfish.setSelected(false);
                lblpasty.setSelected(false);
                txtqty.setText("");
                txttotal.setText("");
            }

    }

if you want remove items from the jtable. select the row of table which item wants to. then click delete button

Delete Button

Paste the code inside the addbutton

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         

             model.removeRow(jTable1.getSelectedRow());      
             int sum=0;
                for(int a=0; a<jTable1.getRowCount(); a++)
                {

                    sum = sum + Integer.parseInt(jTable1.getValueAt(a, 3).toString());

                }
                jLabel4.setText(Integer.toString(sum));                  
    }

I have attached the video tutorial below it will help you  to do this  step by step.

 

admin

Recent Posts

Employee Working Hours Calculation System using C#.net

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

1 week ago

Java Payroll System Calculate Employee Overtime

Act as a Java developer to create a program that calculates the gross wage for…

2 weeks ago

Employee Working Hours Calculation System using Java

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

2 weeks ago

Laravel 11 School Management System

In this tutorial, we will teach you how to create a simple school management system…

3 weeks ago

How to Make Admin Panel Using React MUI

I have design the Admin Basic templete using React MUI Design Admin Dashboard and Login.Here…

1 month ago

Install Laravel Breeze for Authentication Using Laravel 11

In this tutorial ,i am to going teach the Laravel Breeze.Laravel Breeze provides a simple…

1 month ago