2008-03-19
JOptionPane.showInputDialog
关键字: joptionpane.showinputdialogimport javax.swing.JOptionPane;
public class AreaAndCircumferenceProgram {
public static final double PI=3.14;
public static void main(String args[]) throws ArrayIndexOutOfBoundsException
{
double radius;//有异常.没有调出
double area;
double circumference;
String radiusString;
String outputStr;
radiusString=JOptionPane.showInputDialog("Enter the radius:");
radius=Double.parseDouble(radiusString);
area=PI*radius*radius;
circumference=2*PI*radius;
outputStr="Radius:"+radius+"\n"+"Area:"+area+"square units\n"+
"Circumference"+circumference+"units";
JOptionPane.showMessageDialog(null,outputStr,"Circle",JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
发表评论
- 浏览: 20855 次
- 性别:

- 来自: 武汉

- 详细资料
搜索本博客
链接
最新评论
-
学习J2ME可以从事的工作种 ...
关于J2ME程序员新手开发入门的几大要点 一、J2ME中需要的Java基础知 ...
-- by chenchuxin -
学习J2ME可以从事的工作种 ...
J2ME学习之温故而知新篇 学习J2ME最重要的部分是掌握J2ME的体系结构 ...
-- by chenchuxin -
学习J2ME可以从事的工作种 ...
目前從事第二個選項。糾正:應用開發一樣要熟練掌握低級界面編程。
-- by hzxdark -
(转)如何学习J2EE
好在亡羊不牢,为时不晚;
-- by chenchuxin -
(转)如何学习J2EE
有自己的思想 不要问别人怎么学 吸收正确的思想 别人也许是公车上的人呢; 有个职 ...
-- by chenchuxin






评论排行榜