diff --git a/build.fxbuild b/build.fxbuild index 6c95a91..65ab0f4 100644 --- a/build.fxbuild +++ b/build.fxbuild @@ -1,7 +1,7 @@ - + diff --git a/resources/Frazioni.fxml b/resources/Frazioni.fxml index 5c64e55..efd5777 100644 --- a/resources/Frazioni.fxml +++ b/resources/Frazioni.fxml @@ -1,25 +1,85 @@ + + - + + + + + + - - - + + + + + + diff --git a/src/it/nave/math/controller/FrazioniController.java b/src/it/nave/math/controller/FrazioniController.java index 0df176e..c13b003 100644 --- a/src/it/nave/math/controller/FrazioniController.java +++ b/src/it/nave/math/controller/FrazioniController.java @@ -34,7 +34,13 @@ private void backToHome() throws IOException { @FXML private void genera() { - Fraction f = new Fraction(input.getText()); + Fraction f; + try { + f = new Fraction(input.getText()); + } catch (IllegalArgumentException e) { + Tool.inputNotValid("La stringa non č un decimale valido"); + return; + } scriviFrazione(f); } diff --git a/src/it/nave/math/support/Tool.java b/src/it/nave/math/support/Tool.java index bedef5b..812967e 100644 --- a/src/it/nave/math/support/Tool.java +++ b/src/it/nave/math/support/Tool.java @@ -33,7 +33,6 @@ public static Stage setStandardStage(Stage stage, String fxmlFile, String title) Parent root = FXMLLoader.load(Tool.class.getClassLoader().getResource(fxmlFile)); stage.setTitle(title); stage.setScene(new Scene(root)); -// stage.setResizable(false); // FIXME computazionalmente pių efficiente di rendere gli elementi dinamici return stage; }