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

View file

@ -27,6 +27,7 @@ import java.util.ResourceBundle;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javafx.application.Platform;
import javafx.scene.control.*; import javafx.scene.control.*;
import zutil.log.LogUtil; import zutil.log.LogUtil;
@ -100,7 +101,13 @@ public class NetLogGuiClientInstance implements Initializable, NetLogListener {
public void handleLogMessage(NetLogMessage msg) { public void handleLogMessage(NetLogMessage msg) {
if(status == Status.RUNNING){ if(status == Status.RUNNING){
logTable.getItems().add(msg); 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));
}
});
} }
} }