JButton button1
JButton button1
is the next component added (lines 43–44). By default, the weightx
and weighty
values are still zero. The fill
variable is set to HORIZONTAL
—the component will always fill its area in the horizontal direction. The vertical direction is not filled. The weighty
value is zero, so the button will become taller only if another component in the same row has a nonzero weighty
value. JButton button1
is located at row 0, column 1. One row and two columns are occupied.
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.