I built this program but when I run it the while loop doesn't allow you to pick a new shape it just keeps asking for the new enteries for the same shape how do i get the while loop to go back to the beginning

import javax.swing.JOptionPane;

public class ShapesCalcLoop {

public static void main(String[] args) {

//Prompt the user to Enter S, C, T, or Q to quit

char shape = JOptionPane.showInputDialog("Enter S, C, T, or Q to quit: ").charAt(0);

while (shape != 'Q'){

switch (shape){

case 's':;

case 'S': {

String lengthString = JOptionPane.showInputDialog("Enter length of side: ");

double length = Double.parseDouble(lengthString);

//Calculate perimeter and area of square

double perimeter= ( 4 * length);

double area=(length*length);

String output = "Perimeter is equal to: " + perimeter + "\n" + "Area is equal to: " + area;

JOptionPane.showMessageDialog(null,output);

}; break;

case 'c':;

case 'C': {

String radiusString = JOptionPane.showInputDialog("Enter radius: ");

double radius = Double.parseDouble(radiusString);

//Calculate circumference and area of circle

double circumference= (2*3.14*radius);

double area = (Math.PI * (radius * radius));

String output2 ="Circumference is equal to: " + circumference + "\n" + "Area is equal to: " + area;

JOptionPane.showMessageDialog(null,output2);

}; break;

case 't':;

case 'T': {

String baseString = JOptionPane.showInputDialog("Enter length of base: ");

double base = Double.parseDouble(baseString);

String heightString = JOptionPane.showInputDialog("Enter height of triange: ");

double height = Double.parseDouble(heightString);

//Calculate area of triangle

double area = (base * height) / 2;

String output3 = "Area is equal to: " + area;

JOptionPane.showMessageDialog(null,output3);

}; break;

default: {

JOptionPane.showMessageDialog(null,"Incorrect variable please enter S,C, or T only");

System.exit(1);

};

JOptionPane.showMessageDialog(null,"This program was written by Justeena Leonard");

}

}

}

}