This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JComboBox

 
John Brookes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried setting them invisible (setVisible(false)) before they are populated??? Or maybe setPopupVisible()?
 
John Brookes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic