import javax.swing.*; import java.awt.*; public class ChatRoomGUI extends JFrame { private final String WINDOWS_TITLE = "AUT Chat Room"; private final int WIDTH = 500, HEIGHT = 500; private final int X = 100, Y = 100; public ChatRoomGUI() { super(); this.setTitle(WINDOWS_TITLE); this.setLayout(new BorderLayout()); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(WIDTH, HEIGHT); this.setLocation(X, Y); MAssagePanel mAssagePanel=new MAssagePanel(); this.add(mAssagePanel,BorderLayout.PAGE_END); ChatArea chatBox = new ChatArea(); this.add(new JScrollPane(chatBox), BorderLayout.CENTER); USernamePanle uSernamePanle=new USernamePanle(); this.add(uSernamePanle,BorderLayout.LINE_START); this.setVisible(true); } }