labelled the name of the room when in it

This commit is contained in:
Clément
2025-03-12 23:34:08 +01:00
parent 631cd25a9d
commit 67124f4731
2 changed files with 19 additions and 6 deletions

View File

@@ -44,6 +44,9 @@ public class ClientGuiController implements ClientListener {
@FXML
private ScrollPane chatPane;
@FXML
private Label roomName;
public void setClient(Client client) {
this.client = client;
}
@@ -183,11 +186,13 @@ public class ClientGuiController implements ClientListener {
*/
private void createChatEnv(String roomName) {
Platform.runLater(() -> {
this.roomName.setText("Room: " + roomName);
chatList.getChildren().clear();
chatInput.getChildren().clear();
Button leaveButton = new Button("Leave room");
leaveButton.setOnAction(event -> {
client.SendLeaveRoom();
this.roomName.setText("");
chatList.getChildren().clear();
chatInput.getChildren().clear();
});