Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

JcomboBox size

 
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.
 
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.
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic