label wont show up unless window resized
hi i have a strange problem, here s the code
/**
* Displays the specified contact
*/
publicvoid displayContact(Contact c)
{
final Contact contact = c;// contact is another class
contactDisplay.removeAll();//contactDisplay is a panel contained in a splitpane
_value.setText(contact.getSurname());//_value is a jlabel
contactDisplay.add(_value);
//System.out.println(contact.getSurname() + contact.getForename());
contactDisplay.repaint();
}
publicvoid valueChanged(javax.swing.event.ListSelectionEvent e){
Contact c = (Contact)contactlist.getSelectedValue();
displayContact(c);
}
basically, a splitpane containts 2 panels, one for contact list and one for displaycontact. once a contact is cliked details should be displayed on the displaycontact panel. however, this does not work unless i readjust the split bar. i.e., if i click on contact A, or B, or C, nothing shows up on the displaycontact panel. but if then i adjust the split bar, or just clikc on it, everything shows up! and program then runs well! ive totally no clue whats goin on here..... help please!

