import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.awt.event.*;

public class ShowList extends JxFrame implements ActionListener {
    JButton Next;
    int index;
    
    public ShowList() {
        super("Image names");
        
        SortedModel ldata = new SortedModel("Names.txt");
        JPanel jp = new JPanel();
        getContentPane().add(jp);
        jp.setLayout(new BorderLayout());
                
        JList nList = new JList(ldata);
        nList.setCellRenderer (new cellRenderer());
        JScrollPane sc = new JScrollPane();
        sc.getViewport().setView(nList);
        jp.add ("Center", sc);
        JButton Next = new JButton("Next");
        JPanel bot = new JPanel();
        jp.add("South", bot);
        bot.add(Next);
        Next.addActionListener (this);

        nList.addMouseListener(new mouseListener(nList, ldata, this));
        nList.setCellRenderer (new cellRenderer());
        setSize(new Dimension(300,200));
        setVisible(true);
        index = 0;
        
    }
    public void actionPerformed(ActionEvent evt) {
        
                                                                   
    }
    static public void main(String argv[]) {
        new ShowList();
    }
}
