Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JcomboBox size

 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Am using GridBagLayout for displaying the Origin and destination, Carrier combo boxes. Depending upon the length of the text that get displayed the size of the combo changes. It looks pretty odd.I tried overriding setPreferredSize() and setMinimumSize() but still it does'nt seem to work.
Can someone suggest a way to maintain the size of combo at a certain fixed length?
any inputs w'd be highly appreciated
regards,
karthik.
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why your boxes vary in width - "Any" is 3 chars as are all of the origins/destinations. try working with fill and setting the horizontal(GridBagConstraints.HORIZONTAL). The sizes (minimum, preferred)aren't recognized by the GridBagLayout
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
true. I've given an option to select the carrier as well. It defaults to ANY. But carrier codes are longer than 3 letters. Thereby the Carrier combo is larger than others.
I have an option to drop the Carrier combo but i was just wondering what if any of the codes happened to be more than 3 characters long. One of them w'd just stick out. I was just looking to demonstrate the generic nature of criteriaFind and added other search fields.
thanks,
karthik.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic