Skip to content
Snippets Groups Projects
Commit 16794bc0 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #17 - tableview is not cleared correctly

parent 412d5412
Branches
Tags
No related merge requests found
......@@ -112,6 +112,7 @@ public class UserInterfaceController
labelTime.setText("0 h 0 min 0 sek");
createLogView();
loadAll();
// verwaltet den Start/Stopp-Button
......@@ -195,7 +196,7 @@ public class UserInterfaceController
}
catch(IOException d)
{
d.printStackTrace();
Logger.error(d);
}
}
else
......@@ -302,12 +303,19 @@ public class UserInterfaceController
}
catch(Exception ex)
{
ex.printStackTrace();
Logger.error(ex);
AlertGenerator.showAlert(AlertType.ERROR, "Fehler", "", "Fehler beim Erstellen der Datenbank.", icon, stage, null, false);
}
}
}
private void updateTableView()
{
table.getItems().clear();
ObservableList<LogObject> objectsForTable = FXCollections.observableArrayList(logObjects);
table.setItems(objectsForTable);
}
private void createLogView()
{
table.getItems().clear();
......@@ -387,8 +395,6 @@ public class UserInterfaceController
table.getColumns().add(tasks);
table.getColumns().add(durations);
ObservableList<LogObject> objectsForTable = FXCollections.observableArrayList(logObjects);
table.setItems(objectsForTable);
table.setFixedCellSize(26);
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
......@@ -453,7 +459,7 @@ public class UserInterfaceController
public void loadAll()
{
loadFromDB();
createLogView();
updateTableView();
createTreeView();
}
......@@ -723,7 +729,7 @@ public class UserInterfaceController
}
catch(IOException d)
{
d.printStackTrace();
Logger.error(d);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment