Topic: 菜鸟问题,请高手解答 (cannot resolve symbol: JOptionpane)

  Print this page

1.菜鸟问题,请高手解答 (cannot resolve symbol: JOptionpane) Copy to clipboard
Posted by: jasonwing27
Posted on: 2004-10-10 12:31

{ 请尽量用准确的文字描述作为标题
you should cut-and-paste from the command window, instead of using an image! }



总是提示出错,图见附件

//Add.java

import java.awt.* ;
import java.applet.Applet ;
import javax.swing.* ;

public class Add extends Applet
{
double sum = 0 ;

public void init()
{
String FirstNumber ;
String SecondNumber ;
double N1 ;
double N2 ;

FirstNumber = JOptionpane.showinputDialog( "Enter First Number :" ) ;
SecondNnmber = JOptionpane.showinputDialog( "Enter Second Number :" ) ;

N1 = Double.parseDouble( FirstNumber ) ;
N2 = Double.parseDouble( SecondNumber ) ;

sum = N1 + N2 ;
}

public void paint( Graphics g )
{
g.drawString( "The Sum Is :"+sum,25,25 ) ;
g.drawRect( 15,10,270,20 ) ;
}
}

2.Re:菜鸟问题,请高手解答 [Re: jasonwing27] Copy to clipboard
Posted by: why
Posted on: 2004-10-10 12:53

JOptionPane
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html

3.Re:菜鸟问题,请高手解答 [Re: jasonwing27] Copy to clipboard
Posted by: nothing
Posted on: 2004-10-10 12:55

should be :

FirstNumber = JOptionPane.showInputDialog("Enter First Number :");
SecondNumber = JOptionPane.showInputDialog("Enter Second Number :");

4.Re:菜鸟问题,请高手解答 (cannot resolve symbol: JOptionpane) [Re: jasonwing27] Copy to clipboard
Posted by: jasonwing27
Posted on: 2004-10-10 17:56

谢谢两位!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923