1 19 20 package org.lucane.applications.notes.gui.main; 21 22 import java.awt.*; 23 import javax.swing.*; 24 25 import org.lucane.applications.notes.*; 26 27 class CommentListPanel extends JPanel 28 { 29 private JLabel label; 30 private JList list; 31 32 public CommentListPanel(NotesPlugin parent, MyMouseListener listener) 33 { 34 super(); 36 this.setLayout(new BorderLayout()); 37 38 this.label = new JLabel(parent.tr("main.comments")); 39 this.list = new JList(); 40 this.add(label, BorderLayout.NORTH); 41 this.add(list, BorderLayout.CENTER); 42 43 list.setName("comments"); 44 list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 45 list.addMouseListener(listener); 46 } 47 48 public void setListData(Object [] data) 49 { 50 list.setListData(data); 51 } 52 53 public Comment getComment() 54 { 55 return (Comment)list.getSelectedValue(); 56 } 57 } 58 | Popular Tags |