How to loop back from the start of this program i made netbeans 8.1
<p>I have this project I have been working for. I'm trying to add the option to run the project again in a case a user wants to try it again.</p>

<p>How can I loop back to the starting point of my code?</p>

<p>And where should be the right place to input the loop code for it?</p>

<pre><code>public static void main(String[] args) {

    //Input String data types.
    String input, input1, input2, input3, input4, input5, input6, input7, input8, input9, input10;

    //Arithmetic Operators and variables
    int add = 0, sub = 0, mult = 0;
    double div = 0, modulo = 0;

    //Startline of the program
    JOptionPane.showMessageDialog(parentComponent, "Welcome and lets play numbers", "MATHGAME!", 3);//Use "parentComponent" for define dialogs and icons may show up.

    //Ask users to select Operators
    input = JOptionPane.showInputDialog(parentComponent, "Choose an Operator to calculate" + "\n1. Addition" + "\n2. Subtraction" + "\n3. Multiplication"
            + "\n4. Division" + "\n5. Modulo", "OPERATORS", 3);

    //parse selections to input
    int select = Integer.parseInt(input);

    //Use switch for the certain selected operation:
    switch (select) {

        //cast cases for the selected operations
        case 1: //Informations will appear on each cases

            JOptionPane.showMessageDialog(parentComponent, "You've selected Addition", "ADDITION", 2);
            //prompt users how many calculations they want using loops
            input1 = JOptionPane.showInputDialog(parentComponent, "How many Calculation do you want?", "ADDITION", 3);
            int select1 = Integer.parseInt(input1);

            //Declare another Variables to hold the calculations.
            int cal = 1,
             total = 0;
            //use loops for calculations
            while (cal &lt;= select1) {
                //prompt users to enter the numbers to calculate
                input2 = JOptionPane.showInputDialog(parentComponent, "Enter Number to Calculate", "ADDITION", 3);
                add = Integer.parseInt(input2);
                //Increment calculations
                cal++;
                // function of the operator
                total = (int) (add + total);
            }
            // the final answer for the calculation
            JOptionPane.showMessageDialog(parentComponent, "Your Sum is: " + total, "ADDITION", 2);
            break; //break to stop the calculation and let the user to select another operations

        case 2:
            JOptionPane.showMessageDialog(parentComponent, "You've selected Subtraction", "SUBTRACTION", 2);
            input3 = JOptionPane.showInputDialog(parentComponent, "How many Calculation do you want?", "SUBTRACTION", 3);
            int select2 = Integer.parseInt(input3);
            int cal1 = 1,
             total1 = 0;
            while (cal1 &lt;= select2) {
                input4 = JOptionPane.showInputDialog(parentComponent, "Enter Number to Calculate", "SUBTRACTION", 3);
                sub = Integer.parseInt(input4);
                cal1++;
                total1 = (int)  (sub - total1);
            }
            int nom = total1 - sub;
            JOptionPane.showMessageDialog(parentComponent, "Your Difference is: " + (nom), "SUBTRACTION", 2);
            break;

        case 3:
            JOptionPane.showMessageDialog(parentComponent, "You've selected Multiplication", "MULTIPLICATION", 2);
            input5 = JOptionPane.showInputDialog(parentComponent, "How many Calculation do you want?", "MULTIPLICATION", 3);
            int select3 = Integer.parseInt(input5);
            int cal2 = 1,
             total2 = 0;
            while (cal2 &lt;= select3) {
                input6 = JOptionPane.showInputDialog(parentComponent, "Enter Number to Calculate", "MULTIPLICATION", 3);
                mult = Integer.parseInt(input6);
                cal2++;
                total2 = (int) (mult * mult);
            }
            JOptionPane.showMessageDialog(parentComponent, "Your Product is: " + (total2), "MULTIPLICATION", 2);
            break;

        case 4:
            JOptionPane.showMessageDialog(parentComponent, "You've selected Division", "DIVISION", 2);
            input7 = JOptionPane.showInputDialog(parentComponent, "How many Calculation do you want?", "DIVISION", 3);
            int select4 = Integer.parseInt(input7);
            int cal3 = 1,
             total3 = 0;
            while (cal3 &lt;= select4) {
                input8 = JOptionPane.showInputDialog(parentComponent, "Enter Number to Calculate", "DIVISION", 3);
                div = Double.parseDouble(input8);
                cal3++;
                total3 = (int) (double) (div / div);
            }
            JOptionPane.showMessageDialog(parentComponent, "Your Quotient is: " + (total3), "DIVISION", 2);
            break;

        case 5:
            JOptionPane.showMessageDialog(parentComponent, "You've selected Percentage", "PERCENTAGE", 2);
            input9 = JOptionPane.showInputDialog(parentComponent, "How many Calculation do you want?", "PERCENTAGE", 3);
            int select5 = Integer.parseInt(input9);
            int cal4 = 1,
             total4 = 0;
            while (cal4 &lt;= select5) {
                input10 = JOptionPane.showInputDialog(parentComponent, "Enter Number to Calculate", "PERCENTAGE", 3);
                modulo = Double.parseDouble(input10);
                cal4++;
                total4 = (int) (modulo + total4);
            }
            double num = total4 / select5;
            JOptionPane.showMessageDialog(parentComponent, "Your Average is: " + (num), "PERCENTAGE", 2);
            break;
        default: // Default code to prompt error to users that inputs wrong input.
            JOptionPane.showMessageDialog(parentComponent, "Input Out of RANGE!", "ERROR", 2);
            break;

    }
    //Prompt users to do more calculations using loops
            String again = JOptionPane.showInputDialog(parentComponent, "Do you want to calculate more?" + "\n1. Yes"
                    + "\n2. No", "AGAIN?", 3);
            int term = Integer.parseInt(again); //parse for selections
            if (term == 1){

            }
            else {
                JOptionPane.showMessageDialog(parentComponent,"ThankYou");
            }

}
public static Component parentComponent;}
</code></pre>