Source:
public void initialise() { setLayout(new BorderLayout()); JPanel generalInfoPanel = new JPanel(); generalInfoPanel.setLayout(new BorderLayout(5,5)); generalInfoPanel.setBorder(BorderFactory.createTitledBorder("General information")); JPanel fieldInfo = new JPanel(); fieldInfo.setLayout(new GridLayout(0,2)); fieldInfo.add(new JLabel("Field name: ")); fieldInfo.add(nameLabel); fieldInfo.add(new JLabel("Field type: ")); fieldInfo.add(rowCountLabel); generalInfoPanel.add(fieldInfo,BorderLayout.NORTH); JPanel descriptionInfo = new JPanel(); descriptionInfo.setLayout(new GridLayout(0,2)); descriptionInfo.add(new JLabel("Description: ")); descriptionInfo.add(description); generalInfoPanel.add(descriptionInfo,BorderLayout.SOUTH); add(generalInfoPanel, BorderLayout.NORTH); JTable table = new JTable(valueTable); JScrollPane fieldListPanel = new JScrollPane(table); table.setFont(font); table.setRowHeight(24); table.setBorder(new MatteBorder(1, 0, 1, 0, Color.BLACK)); table.setCellSelectionEnabled(true); if (isTargetFieldPanel) { table.getColumnModel().getColumn(1).setPreferredWidth(100); table.getColumnModel().getColumn(2).setPreferredWidth(100); } if (!isTargetFieldPanel) { table.getColumnModel().getColumn(0).setPreferredWidth(500); DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer(); rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT); table.getColumnModel().getColumn(1).setCellRenderer(rightRenderer); table.getColumnModel().getColumn(2).setCellRenderer(rightRenderer); } String title = isTargetFieldPanel ? "Concept ID Hints" : "Value Counts"; fieldListPanel.setBorder(BorderFactory.createTitledBorder(title)); add(fieldListPanel, BorderLayout.CENTER); JScrollPane commentsPanel = new JScrollPane(commentsArea); commentsArea.setFont(font); commentsArea.getDocument().addDocumentListener(this); commentsArea.setWrapStyleWord(true); commentsArea.setLineWrap(true); addUndoToTextArea(commentsArea); commentsPanel.setBorder(BorderFactory.createTitledBorder("Comments")); commentsPanel.setPreferredSize(new Dimension(100, 200)); add(commentsPanel, BorderLayout.SOUTH); }

Target:
public void initialise() { setLayout(new BorderLayout()); JPanel generalInfoPanel = new JPanel(); generalInfoPanel.setLayout(new BorderLayout(5,5)); generalInfoPanel.setBorder(BorderFactory.createTitledBorder("General information")); JPanel fieldInfo = new JPanel(); fieldInfo.setLayout(new GridLayout(0,2)); fieldInfo.add(new JLabel("Field name: ")); fieldInfo.add(nameLabel); fieldInfo.add(new JLabel("Field type: ")); fieldInfo.add(rowCountLabel); generalInfoPanel.add(fieldInfo,BorderLayout.NORTH); JPanel descriptionInfo = new JPanel(); descriptionInfo.setLayout(new GridLayout(0,2)); descriptionInfo.add(new JLabel("Description: ")); descriptionInfo.add(description); generalInfoPanel.add(descriptionInfo,BorderLayout.SOUTH); add(generalInfoPanel, BorderLayout.NORTH); JTable table = new JTable(valueTable); JScrollPane fieldListPanel = new JScrollPane(table); table.setFont(font); table.setRowHeight(24); table.setBorder(new MatteBorder(1, 0, 1, 0, Color.BLACK)); table.setCellSelectionEnabled(true); if (isTargetFieldPanel) { table.getColumnModel().getColumn(1).setPreferredWidth(300); table.getColumnModel().getColumn(2).setPreferredWidth(100); } if (!isTargetFieldPanel) { table.getColumnModel().getColumn(0).setPreferredWidth(500); DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer(); rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT); table.getColumnModel().getColumn(1).setCellRenderer(rightRenderer); table.getColumnModel().getColumn(2).setCellRenderer(rightRenderer); } String title = isTargetFieldPanel ? "Concept ID Hints" : "Value Counts"; fieldListPanel.setBorder(BorderFactory.createTitledBorder(title)); add(fieldListPanel, BorderLayout.CENTER); JScrollPane commentsPanel = new JScrollPane(commentsArea); commentsArea.setFont(font); commentsArea.getDocument().addDocumentListener(this); commentsArea.setWrapStyleWord(true); commentsArea.setLineWrap(true); addUndoToTextArea(commentsArea); commentsPanel.setBorder(BorderFactory.createTitledBorder("Comments")); commentsPanel.setPreferredSize(new Dimension(100, 200)); add(commentsPanel, BorderLayout.SOUTH); }