From 9c80a1d7223134f0a92c5e9b824291e8924dd51e Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Sun, 12 Jun 2016 00:40:59 +0200 Subject: [PATCH] Fixed Save menuItem bug --- src/main/java/es/kauron/jstudy/controller/Controller.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/es/kauron/jstudy/controller/Controller.java b/src/main/java/es/kauron/jstudy/controller/Controller.java index cc2ee5e..ebc4147 100644 --- a/src/main/java/es/kauron/jstudy/controller/Controller.java +++ b/src/main/java/es/kauron/jstudy/controller/Controller.java @@ -40,10 +40,9 @@ public class Controller implements Initializable { @Override public void initialize(URL url, ResourceBundle resourceBundle) { tabPane.getSelectionModel().selectedItemProperty().addListener((change, o, n) -> { - if (n.getContent().getId() != null) { + if (tabMap.get(n) != null) { table.set(true); - root.getTop().autosize(); - } + } else table.set(false); }); saveMenu.disableProperty().bind(table.not()); } @@ -81,7 +80,6 @@ public class Controller implements Initializable { private Tab createTableTab(String name, List list) { try { Tab tab = new Tab(name); - tab.setId("table" + tab.hashCode()); FXMLLoader loader = new FXMLLoader(Main.class.getResource("view/table.fxml")); Parent tableRoot = loader.load();