package net.sf.jabref.gui.entryeditor;

import java.util.HashMap;
import java.util.Optional;

import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import net.sf.jabref.gui.BasePanel;
import net.sf.jabref.gui.JabRefFrame;
import net.sf.jabref.logic.pdf.PdfCommentImporter;
import net.sf.jabref.model.entry.FieldName;

public class PdfCommentsTab {

    private final JPanel panel = new JPanel();

    private JList<String> commentList = new JList<>();

    private final JScrollPane scrollPane = new JScrollPane();

    //TODO add final

    private EntryEditor parent;

    private String tabTitle;

    private JabRefFrame frame;

    private BasePanel basePanel;

    public PdfCommentsTab(EntryEditor parent, JabRefFrame frame, BasePanel basePanel) {
        this.parent = parent;
        this.frame = frame;
        this.basePanel = basePanel;
        this.tabTitle = "PDF comments";
        this.setUpPdfCommentsTab();
    }

    private void setUpPdfCommentsTab() {
        Optional<String> field = parent.getEntry().getField(FieldName.FILE);
        if (field.isPresent()) {
            DefaultListModel<String> listModel = new DefaultListModel<>();
            commentList.setModel(listModel);
            PdfCommentImporter commentImporter = new PdfCommentImporter();
            HashMap<String, String> importedNotes = commentImporter.importNotes(field.get());
            for (String note : importedNotes.values()) listModel.addElement(note);

        }

    }

}

@@ -582,30 +582,8 @@
 );%0A%0A
-    //TODO add final%0A%0A
     
@@ -590,16 +590,22 @@
 private 
+final 
 EntryEdi
@@ -629,16 +629,22 @@
 private 
+final 
 String t
@@ -665,16 +665,22 @@
 private 
+final 
 JabRefFr
@@ -703,16 +703,22 @@
 private 
+final 
 BasePane
@@ -1143,24 +1143,69 @@
 resent()) %7B%0A
+            System.out.println(%22isPresent%22);%0A
             
@@ -1568,19 +1568,141 @@
 e);%0A
-%0A        %7D%0A
+            commentList.setVisible(true);%0A            System.out.println(listModel.get(1));%0A        %7D%0A        panel.add(commentList);
 %0A   

Add final modifier, add commentList to panel