The area of a circle is 3.14*radius*radius rather than 3.14 *(radius*2)
The following static method start() may do one run to calculate the area of a circle.
private static void start() {
String n = JOptionPane.showInputDialog(null,"Enter the radius to calculate the area of a Circle");
int num = Integer.parseInt(n);
DecimalFormat twoDigit= new DecimalFormat("0.00");
double form1 = 3.14 * (num*num);
JOptionPane.showMessageDialog(null,"The area of the circle is "+ twoDigit.format(form1));
}
extemer, can you clearify your intention: What do you want to do with this program?
1. after one run, you want to finish the program's execution, or
2. after one run, you want to do another run until client clicks the cancel button to stop the execution of this program?