import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import javax.swing.BoxLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; public class View { public static void main(String[] args) { JFrame frame = new JFrame("My Last View"); final int WIDTH = 300; final int HEIGHT = 400; Dimension dimension = new Dimension(WIDTH, HEIGHT); frame.setSize(dimension); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container container = frame.getContentPane(); FlowLayout flowLayout = new FlowLayout(); container.setLayout(flowLayout); final int ROWS = 20; final int COLUMNS = 10; JPanel codePanel = new JPanel(); BoxLayout boxLayout = new BoxLayout(codePanel, BoxLayout.PAGE_AXIS); codePanel.setLayout(boxLayout); JLabel codeLabel = new JLabel("Code"); codePanel.add(codeLabel); JTextArea code = new JTextArea(ROWS, COLUMNS); JScrollPane codePane = new JScrollPane(code); codePane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); codePane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); codePanel.add(codePane); container.add(codePanel); JPanel feedbackPanel = new JPanel(); boxLayout = new BoxLayout(feedbackPanel, BoxLayout.PAGE_AXIS); feedbackPanel.setLayout(boxLayout); JLabel feedbackLabel = new JLabel("Feedback"); feedbackPanel.add(feedbackLabel); JTextArea feedback = new JTextArea(ROWS, COLUMNS); JScrollPane feedbackPane = new JScrollPane(feedback); feedbackPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); feedbackPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); feedbackPanel.add(feedbackPane); container.add(feedbackPanel); frame.setVisible(true); } }