This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes List Width? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "List Width?" Watch "List Width?" New topic

List Width?

Dan Temple
Ranch Hand

Joined: Jul 10, 2001
Posts: 93
Here is a simple question that I can't find in the docs: What determines the width of a List component? There are no constructors that take width as a parameter.
Thanks in Advance
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Dan,
IMO, the underlying layout sizes the list. If you use a null layout the list might use the largest initial string to size itself.
I agree. Here's the link:
subject: List Width?
It's not a secret anymore!