Changed bgc of testArea and played on pref size of list and scrollPane
This commit is contained in:
parent
bb1cb6658e
commit
5b6f6bf058
@ -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);
|
||||
|
@ -91,7 +91,7 @@ public class MessageListRenderer implements ComponentListCellRenderer<Message> {
|
||||
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);
|
||||
|
Reference in New Issue
Block a user