diff --git a/src/main/java/com/jFxKasse/controller/MainWindowController.java b/src/main/java/com/jFxKasse/controller/MainWindowController.java index 4f5a7b7..56d57c9 100644 --- a/src/main/java/com/jFxKasse/controller/MainWindowController.java +++ b/src/main/java/com/jFxKasse/controller/MainWindowController.java @@ -513,7 +513,11 @@ public class MainWindowController { xmlc.setHeader(tftheader.getText()); xmlc.setFooter(tftfooter.getText()); xmlc.setCategorySplitted(switchSeparate.isSelected()); - xmlc.setAutoPrintBill(switchAutoPrint.isSelected()); + + // Only save if checkbox exists (might be null if FXML not updated) + if (switchAutoPrint != null) { + xmlc.setAutoPrintBill(switchAutoPrint.isSelected()); + } try { xmlc.saveSettings(); @@ -870,7 +874,10 @@ public class MainWindowController { switchSeparate.setSelected(xmlc.getCategorySplitted()); - switchAutoPrint.setSelected(xmlc.getAutoPrintBill()); + // Only set if checkbox exists (might be null if FXML not updated) + if (switchAutoPrint != null) { + switchAutoPrint.setSelected(xmlc.getAutoPrintBill()); + } updatePrintButtonLabel(); @@ -881,7 +888,7 @@ public class MainWindowController { btnPrintBill.setText("Drucken"); } else { - btnPrintBill.setText("Bestellen"); + btnPrintBill.setText("Buchen"); } } @@ -1399,4 +1406,4 @@ public class MainWindowController { return 404; } -} +} \ No newline at end of file