Hallo!
Ich habe das Problem, dass der befehl JOptionPane.showInputDialog() bei mir nicht funktionier (weder in netbeans noch in eclipse).Ich will ein Programm schreiben, welches die Fakultät der Eingabezahl berechnet und ausgibt. Hier der Quellcode, vllt kann mir jmd sagen was ich bei JOptionPane.showInputDialog() noche infügen muss. (genauer Error: "JOptionPane cannot be resolved")
package SCHLEIFEN1;
public class FORschleife {
public static void main(String[] args) {
String s1 = JOptionPane.showInputDialog("Bitte geben Sie die erste Zahl ein!");
long f = 1;
double n = Double.parseDouble(s1);
for (int i = 1; i <= n; i=i+1){f=f*i;}
{
System.out.println("Die Fakultät von " + n + " ist " + f);
}
}}
danke im voraus