Fixed log count counter

This commit is contained in:
Ziver Koc 2013-05-28 21:24:25 +00:00
parent c1604cc5be
commit 30c0b95437
2 changed files with 11 additions and 4 deletions

View file

@ -33,6 +33,9 @@
-->
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="zutil.log.net.NetLogGuiClientInstance">
<stylesheets>
<URL value="@NetLogClientInstance.css" />
</stylesheets>
<bottom>
<ToolBar maxHeight="22.0" minHeight="19.0" prefHeight="22.0" prefWidth="839.0">
<items>
@ -81,9 +84,6 @@
</items>
</SplitPane>
</center>
<stylesheets>
<URL value="@NetLoggerClientInstance.css" />
</stylesheets>
<top>
<ToolBar maxHeight="30.0" minHeight="22.0" prefHeight="30.0" prefWidth="839.0">
<items>

View file

@ -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));
}
});
}
}