FileDocCategorySizeDatePackage
SimpleList.javaAPI DocExample1509Thu Oct 24 20:14:22 BST 2002None

SimpleList

public class SimpleList extends JPanel

Fields Summary
String[]
label
JList
list
Constructors Summary
public SimpleList()


      
        this.setLayout(new BorderLayout());
        list = new JList(label);
        JScrollPane pane = new JScrollPane(list);
        JButton button = new JButton("Print");
        button.addActionListener(new PrintListener());

        add(pane, BorderLayout.CENTER);
        add(button, BorderLayout.SOUTH);
    
Methods Summary
public static voidmain(java.lang.String[] s)

         JFrame frame = new JFrame("Simple List Example");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setContentPane(new SimpleList());
         frame.setSize(250, 200);
         frame.setVisible(true);