Updates to GUI
This commit is contained in:
parent
306675421f
commit
db9b2bf307
6 changed files with 212 additions and 50 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package zutil.log.netlog;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
|
|
@ -7,7 +9,9 @@ import javafx.fxml.FXMLLoader;
|
|||
import javafx.stage.Stage;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
|
||||
public class NetLoggerClient extends Application{
|
||||
public static final String VERSION = "0.1";
|
||||
|
|
@ -30,11 +34,11 @@ public class NetLoggerClient extends Application{
|
|||
stage.show();
|
||||
}
|
||||
|
||||
// Menu Actioins
|
||||
// Menu Actions
|
||||
@FXML
|
||||
protected void handleConnectAction(ActionEvent event) {
|
||||
try{
|
||||
tabPane.getTabs().add(new NetLoggerClientInstance("koc.se", 8080));
|
||||
tabPane.getTabs().add(new NetLoggerClientTab("koc.se", 8080));
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -49,4 +53,19 @@ public class NetLoggerClient extends Application{
|
|||
protected void handleAboutAction(ActionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
private class NetLoggerClientTab extends Tab{
|
||||
public NetLoggerClientTab(String host, int port) throws IOException{
|
||||
this.setText( host+":"+port );
|
||||
|
||||
Parent tabRoot = FXMLLoader.load(getClass().getResource("NetLoggerClientInstance.fxml"));
|
||||
this.setContent(tabRoot);
|
||||
AnchorPane.setRightAnchor(tabRoot, 0.0);
|
||||
//this.setOnClosed(new EventHandler<Event>() {
|
||||
// public void handle(Event e) {
|
||||
// handleDisconnectAction(e);
|
||||
// }
|
||||
//});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue