Dialog.java [Last ned]

import static javax.swing.JOptionPane.*;
 
public class Dialog {
 
  public static String lesString(String m) {
    String innTxt = showInputDialog(m);
    return innTxt;
  }
 
  public static int lesInt(String m) {
    String innTxt = showInputDialog(m);
    int tall = Integer.parseInt(innTxt);
    return tall;
  }
 
  public static double lesDouble(String m) {
    String innTxt = showInputDialog(m);
    double tall = Double.parseDouble(innTxt);
    return tall;
  }
 
}
Kildekode blir vist ved hjelp av GeSHi.