I have a few JComboBox instances in a GUI I've made. They all start off empty and get populated by the user, but because they start empty they look rubbish on the screen. I can't for the life of me find a way to set a default string to appear in an otherwise empty combo box. I just want to put in "-----" or something to set an initial size.
Joined: Oct 13, 2005
Have you tried setting them invisible (setVisible(false)) before they are populated??? Or maybe setPopupVisible()?
Joined: Feb 26, 2004
Ah good call. I'll give it a go but I'd rather have them in place with a default string to keep the layout more consistent.