Package client

Class ChatListGUI

java.lang.Object
client.ChatListGUI

public class ChatListGUI extends Object
Provides a graphical interface for displaying a list of available chat rooms. This class uses a GridBagLayout to stack chat selection buttons vertically at the top of the panel.
  • Constructor Details

    • ChatListGUI

      public ChatListGUI()
      Constructs an empty ChatListGUI with a GridBagLayout.
    • ChatListGUI

      public ChatListGUI(ArrayList<String> chats, String ActiveChat)
      Constructs a ChatListGUI populated with buttons for each chat room. Buttons are configured to stretch horizontally and anchor to the top, with a spacer at the bottom to prevent buttons from spreading out vertically. * @param chats An ArrayList of strings representing the names of the available chat rooms.
      Parameters:
      ActiveChat - The name of the currently active chat room.
  • Method Details

    • setActiveChat

      public void setActiveChat(String activeChat)
      Updates the chat list to visually indicate which chat is currently active.
      Parameters:
      activeChat - Name of the chat
    • getChatListPanel

      public JPanel getChatListPanel()
      Returns the panel containing the chat list components. * @return The JPanel displaying the chat buttons.