How to fix ListBox and Panel size in an applet using GridBagLayout as Layout manager? I have an applet with a Panel and two ListBoxes in the Panel. The layout manager I use is GridBagLayout. When I populate the listboxes with data (string). Their size (both the panel and listbox) vary with the length of data string. How can I fix the size of these listboxes and panel? How can utilize the preferredSize() and getPreferredSize() methods? Will they help? Thanks in advance.
gridbag layout references getPreferredSize, and getMinimumSize (info courtesy of Professional Java Programming, WROX press, thanks Java Ranch!) so you will need to set both of them to the size you want. Ie: combo.setPreferredSize(100,20); combo.setMinimumSize(100, 20); HTH
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>"Those who cast the votes decide nothing. Those who count the<BR>votes decide<BR>everything." <BR> -Joseph Stalin<HR></BLOCKQUOTE>