Hello guys,

How can I align the label with the combo box in the given code? I tried the
setAlignmentX() and setAlignmentY() but it didn't do the magic..


public class JButtonO extends JFrame{

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

   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);
       JComboBox container = new JComboBox();
       for(int i = 0; i<values.length;++i)
           container.addItem(values[i]);
       panel.add(label);
       panel.add(container);


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

   }

Thanks

-- 
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