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?");