Skip to content

Commit

Permalink
Gui now shows when disconnected as well
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinRepo committed Mar 16, 2022
1 parent 848d400 commit 54a0384
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/me/dustin/chatbot/gui/ChatBotGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ public void windowClosing(java.awt.event.WindowEvent windowEvent) {

public void tick() {
stopWatch.reset();
frame.setTitle("ChatBot - Connected to: " + clientConnection.getIp() + ":" + clientConnection.getPort() + " for: " + GeneralHelper.getDurationString(ChatBot.connectionTime()));
if (clientConnection == null || !clientConnection.isConnected())
frame.setTitle("ChatBot - Disconnected");
else
frame.setTitle("ChatBot - Connected to: " + clientConnection.getIp() + ":" + clientConnection.getPort() + " for: " + GeneralHelper.getDurationString(ChatBot.connectionTime()));
}

public JFrame getFrame() {
Expand Down

0 comments on commit 54a0384

Please sign in to comment.