JPanel () { JPanel messagePanel = new JPanel(new BorderLayout()); if (myMessage != null) { JComponent textComponent = createTextComponent(); messagePanel.add(textComponent, BorderLayout.NORTH); } myField = createTextFieldComponent(); messagePanel.add(createScrollableTextComponent(), BorderLayout.CENTER); myCheckBox = new JCheckBox(); messagePanel.add(myCheckBox, BorderLayout.SOUTH); return messagePanel; }