1 package autolaskuri.comp;
3 import java.io.IOException;
5 import java.util.ArrayList;
7 import java.util.ResourceBundle;
9 import javafx.beans.property.SimpleIntegerProperty;
10 import javafx.fxml.FXML;
11 import javafx.fxml.FXMLLoader;
12 import javafx.fxml.Initializable;
13 import javafx.scene.control.Button;
14 import javafx.scene.control.Label;
15 import javafx.scene.layout.VBox;
23 public class Laskuri extends VBox implements Initializable {
24 @SuppressWarnings(
"javadoc")
25 public static class
Laskettava extends SimpleIntegerProperty {
27 public int inc() {
set(
get()+1);
return get(); }
28 public int reset() {
set(0);
return get(); }
31 @SuppressWarnings(
"javadoc")
33 private List<Laskuri> alkiot =
new ArrayList<>();
35 public void reset() { alkiot.forEach(l -> l.reset()); }
45 FXMLLoader loader =
new FXMLLoader(getClass().getResource(
"LaskuriView.fxml"));
47 loader.setController(
this);
51 catch (IOException ex) {
52 System.err.println(ex.getMessage());
58 public void initialize(URL location, ResourceBundle resources) {