void () { myErrorPanel = new JPanel(new BorderLayout()); myErrorMessages = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 10, 5, true, false)); myErrorPanel.add(myErrorMessages, BorderLayout.PAGE_START); myErrorStack = new JTextArea(50, 20); myErrorStack.setEditable(false); myErrorStackLayout = new CardLayout(); myErrorStackPanel = new JPanel(myErrorStackLayout); myErrorStackPanel.add(new JLabel(), ERROR_NO_STACK_CARD); myErrorStackPanel.add(ScrollPaneFactory.createScrollPane(myErrorStack), ERROR_STACK_CARD); myErrorPanel.add(myErrorStackPanel, BorderLayout.CENTER); myPanel.add(myErrorPanel, ERROR_CARD); }