Hello,

How can I get the scroller around my JList component in the code given
below? It doesn't seem to work properly :(


public class JButtonO extends JFrame{

    String[] values = {"henry", "Michael","Uche","John","Ullan","Nelly",

"Ime","Lekan","Austine","jussi","Ossi","Imam","Empo","Austine","Becky",
                                 "Scholar","Ruth", "Anny"};

   public JButtonO()
    {
       super("the button");
       this.setSize(400,200);
       JPanel panel =  new JPanel();
       JLabel label = new JLabel("Output Items:");
       label.setAlignmentX(1);
       label.setAlignmentY(1);
       JList conList = new JList(values);
       conList.setVisibleRowCount(3);
       JScrollPane scroller = new JScrollPane(conList);
       panel.add(label);
       panel.add(scroller);
       panel.add(conList);

       this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       this.add(panel);
       this.setVisible(true);


   }

-- 
You received this message because you are subscribed to the Google Groups 
"JPassion.com: Java Programming" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jpassion_java?hl=en.

Reply via email to