0

Scanner を使用してこのコードを使用していますが、getPosNumber で JOptionPane を使用してこのコードを使用したいと考えています。compareTo() を試しましたが、うまくいきません。ありがとう!

int height;
int length;

length = getPosNumber("What is the length of the rectangle?");
height = getPosNumber("What is the height of the rectangle?");
4

1 に答える 1

0
length =  getPosNumber( Integer.parseInt( JOptionPane.showInputDialog( "What is the length of the rectangle?")));

APIを参照してください:http://docs.oracle.com/javase/6/docs/api/javax/swing/JOptionPane.html

于 2012-11-05T08:07:37.693 に答える