From 30c0b95437f7fbc771068f387e45baa3e9e820bd Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Tue, 28 May 2013 21:24:25 +0000 Subject: [PATCH] Fixed log count counter --- src/zutil/log/net/NetLogClientInstance.fxml | 6 +++--- src/zutil/log/net/NetLogGuiClientInstance.java | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/zutil/log/net/NetLogClientInstance.fxml b/src/zutil/log/net/NetLogClientInstance.fxml index 65aadaf..66cfac8 100644 --- a/src/zutil/log/net/NetLogClientInstance.fxml +++ b/src/zutil/log/net/NetLogClientInstance.fxml @@ -33,6 +33,9 @@ --> + + + @@ -81,9 +84,6 @@ - - - diff --git a/src/zutil/log/net/NetLogGuiClientInstance.java b/src/zutil/log/net/NetLogGuiClientInstance.java index 6942b09..59187c8 100644 --- a/src/zutil/log/net/NetLogGuiClientInstance.java +++ b/src/zutil/log/net/NetLogGuiClientInstance.java @@ -27,6 +27,7 @@ import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; +import javafx.application.Platform; import javafx.scene.control.*; import zutil.log.LogUtil; @@ -100,7 +101,13 @@ public class NetLogGuiClientInstance implements Initializable, NetLogListener { public void handleLogMessage(NetLogMessage msg) { if(status == Status.RUNNING){ logTable.getItems().add(msg); - logCountLabel.setText(""+Integer.parseInt(logCountLabel.getText())+1); + + Platform.runLater(new Runnable() { + @Override + public void run() { + logCountLabel.setText("" + (Long.parseLong(logCountLabel.getText()) + 1)); + } + }); } }