Calculating Diameter, Circumference, Area and Length of a Circle
In today tutorial on writing codes in Java, we will be writing a program using the Java GUI (Graphics User Interface) framework; that asks a user to input the radius and degree of a circle, the program reads it in and calculates: The radius, Diameter, Circumference, Area and Length of a circle. Before using the Java GUI, we need to import the javax.swing.JOptionPane. Javax. swing is part of Java Foundation Classes that is used to create window based applications. It provides classes for Java API(Application Program Interface) such as the JButton, JPanel, JTextField and so on. import javax.swing.JOptionPane; public class Circle{ public static void main(String args[]) { int x; int y; int diameter; double circumference; double area; double length; String xVal; String yVal; xVal = JOptionPane.showInputDi...