Package client
Class ChatListGUI
java.lang.Object
client.ChatListGUI
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 Summary
ConstructorsConstructorDescriptionConstructs an empty ChatListGUI with a GridBagLayout.ChatListGUI(ArrayList<String> chats, String ActiveChat) Constructs a ChatListGUI populated with buttons for each chat room. -
Method Summary
Modifier and TypeMethodDescriptionReturns the panel containing the chat list components.voidsetActiveChat(String activeChat) Updates the chat list to visually indicate which chat is currently active.
-
Constructor Details
-
ChatListGUI
public ChatListGUI()Constructs an empty ChatListGUI with a GridBagLayout. -
ChatListGUI
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
Updates the chat list to visually indicate which chat is currently active.- Parameters:
activeChat- Name of the chat
-
getChatListPanel
Returns the panel containing the chat list components. * @return The JPanel displaying the chat buttons.
-