Question: (TCO 1) Complete the following Java Applet program that will calculate the area of a circle. (hint: area = pi * radius square) import java.awt.*;
(TCO 1) Complete the following Java Applet program that will calculate the area of a circle. (hint: area = pi * radius square) import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Circle { JLabel area; JTextField radius; JButton calculate; public void init() { JPanel panel = new JPanel(new GridLayout(4,2)); panel.add(new JLabel("Radius:")); radius = new JTextField(); panel.add(radius); panel.add(new JLabel("Area:")); area = new JLabel(); panel.add(area); calculate = new JButton("Calculate"); panel.add(calculate); calculate.addActionListener(this); getContentPane().add(panel); } public void actionPerformed(ActionEvent arg0) { } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
