package com.dxxy.interaction;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;
Circle theCircle;
JTextField messageText;
JTextArea resultText;
JButton calButton,closeButton;
//构造方法
public CalculateDemo(){
super("计算圆的面积和周长");
Container c = this.getContentPane();
c.setLayout(new FlowLayout());
JPanel upPanel=new JPanel();
JPanel lowPanel=new JPanel();
JLabel messageLabel=new JLabel("输入圆的半径:");
/*创建各组件*/
messageText=new JTextField(10);
calButton=new JButton("计算");
closeButton=new JButton("关闭窗口");
resultText=new JTextArea(&#
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;
import javax.swing.*;
Circle theCircle;
JTextField messageText;
JTextArea resultText;
JButton calButton,closeButton;
//构造方法
public CalculateDemo(){
super("计算圆的面积和周长");
Container c = this.getContentPane();
c.setLayout(new FlowLayout());
JPanel upPanel=new JPanel();
JPanel lowPanel=new JPanel();
JLabel messageLabel=new JLabel("输入圆的半径:");
/*创建各组件*/
messageText=new JTextField(10);
calButton=new JButton("计算");
closeButton=new JButton("关闭窗口");
resultText=new JTextArea(&#