public class Basis { public static String insertString(String message, String title, String vorgabe) { TextInputDialog dialog = new TextInputDialog(vorgabe); dialog.setTitle(title); dialog.setContentText(message); dialog.setHeaderText(title); dialog.setResizable(true); java.util.Optional result = dialog.showAndWait(); if (result.isPresent()) { return (String)result.get(); } else { return null; } } public static void errorBox( String message, String title) { Dialog alert = new Alert(Alert.AlertType.ERROR,message); alert.setTitle(title); alert.setHeaderText(title); alert.setResizable(true); alert.show(); // a.setContentText(content); } // ErrorBox public static double getDoubleNumber(String str_zahl) { try { double zahl = Double.parseDouble(str_zahl); return zahl; } catch (NumberFormatException e) { return Double.NaN; } // try } // getDoubleNumber public static Integer getIntegerNumber(String str_zahl) { try { int zahl = Integer.parseInt(str_zahl); return zahl; } catch (NumberFormatException e) { return null; } // try } // getIntegerNumber }