GUI Help

I am trying to add a JLabel in the north and JComboBox to the south in my GUI layout however the JLabel is not showing up. For some reason the combobox does show up. Here is my code, any assistance will be greatly appreciated:

privatevoid layoutGUIComponents(Container contents){

contents.setLayout(new BorderLayout());

// YOUR CODE HERE

status =new JLabel();

updateStatus();

contents.add(status);

JComboBox choices =new JComboBox(THRESHOLDS);//Thresholds selection box

choices.setSelectedIndex(6);

choices.addActionListener(new ActionListener(){

publicvoid actionPerformed(ActionEvent e){

doThresholdChanged((JComboBox)e.getSource());

}

});

contents.add(choices);

}

[1251 byte] By [kumar103a] at [2007-11-27 5:39:00]
# 1
You need to specify the location of where to place the component. Check out the add method that takes 2 parameters, Component comp and int index.
floundera at 2007-7-12 15:13:21 > top of Java-index,Java Essentials,Java Programming...
# 2
in the future, Swing related questions should be posted in the Swing forum.[url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Border Layout[/url].
camickra at 2007-7-12 15:13:21 > top of Java-index,Java Essentials,Java Programming...