diff --git a/src/main/java/envoy/client/ui/ChatWindow.java b/src/main/java/envoy/client/ui/ChatWindow.java index eda61e4..c7f74f4 100644 --- a/src/main/java/envoy/client/ui/ChatWindow.java +++ b/src/main/java/envoy/client/ui/ChatWindow.java @@ -133,11 +133,12 @@ public class ChatWindow extends JFrame { // updates list elements when list is resized @Override public void componentResized(ComponentEvent e) { - messageList.synchronizeModel(); var prefSize = e.getComponent().getPreferredSize(); + e.getComponent().setPreferredSize(prefSize); + messageList.synchronizeModel(); messageList.setMinimumSize(new Dimension(prefSize.width, 0)); messageList.setMaximumSize(new Dimension(prefSize.width, Integer.MAX_VALUE)); - messageList.setPreferredSize(new Dimension(prefSize.width, messageList.getPreferredSize().height)); + messageList.setPreferredSize(new Dimension(prefSize.width, (int) messageList.getPreferredSize().getHeight())); } }); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); diff --git a/src/main/java/envoy/client/ui/renderer/MessageListRenderer.java b/src/main/java/envoy/client/ui/renderer/MessageListRenderer.java index 10bece5..e6622b4 100644 --- a/src/main/java/envoy/client/ui/renderer/MessageListRenderer.java +++ b/src/main/java/envoy/client/ui/renderer/MessageListRenderer.java @@ -91,7 +91,7 @@ public class MessageListRenderer implements ComponentListCellRenderer { messageTextArea.setWrapStyleWord(true); messageTextArea.setForeground(theme.getMessageTextColor()); messageTextArea.setAlignmentX(0.5f); - messageTextArea.setBackground(Color.RED); + messageTextArea.setBackground(theme.getCellColor()); messageTextArea.setEditable(false); var font = new Font("Arial", Font.PLAIN, 14); messageTextArea.setFont(font);