I want to create a GUI and Script input option. So I need to add an input argument flag and program logic to use Scanner if false, JOptionPane if true. But i am having trouble doing this.
This is as far as i can get my code because I cant figure out how to get the if else statements and everything to work correctly.
import javax.swing.JOptionPane;
import java.util.Scanner;
import java.util.Calendar;
public class UtilsFL {
public static int readInt(String prompt) {
Scanner input = new Scanner(System.in);
int data;
System.out.print(prompt);
data = input.nextInt();
return data;
}
Aucun commentaire:
Enregistrer un commentaire