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();