JPanel (final TableView<VcsFileRevision> table) { final JTextArea textArea = createTextArea(); table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(@NotNull ListSelectionEvent e) { final VcsFileRevision revision = table.getSelectedObject(); if (revision == null) { textArea.setText(""); } else { textArea.setText(revision.getCommitMessage()); textArea.select(0, 0); } } }); JPanel jPanel = new JPanel(new BorderLayout()); final JScrollPane textScrollPane = ScrollPaneFactory.createScrollPane(textArea); // text on title border has some problems if text font size is bigger than expected. final JLabel commentLabel = new JLabel(VcsBundle.message("border.selected.revision.commit.message")); jPanel.add(commentLabel, BorderLayout.NORTH); commentLabel.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP | SideBorder.LEFT | SideBorder.BOTTOM)); textScrollPane.setBorder(null); jPanel.add(textScrollPane, BorderLayout.CENTER); jPanel.setPreferredSize(new JBDimension(300, 100)); return jPanel; }