Best regards,<br /> <br />Can Zheng
SCJP, SCJD, SCWCD, OCPJBCD
Best regards,<br /> <br />Can Zheng
Is there a way we can get the UI code cleaner
SCJP, SCJD, SCWCD, OCPJBCD
Originally posted by Can Zheng:
After using a layout manager I still need to hard code the components prefered/minimum/maximum size in many cases, and I'm quite uncomfortable with that. Is there a way we can get the UI code cleaner?
Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
I think in many cases you cannot avoid setting some preferred sizes
SCJP, SCJD, SCWCD, OCPJBCD
Each component managed by a GridBagLayout is associated with an instance of GridBagConstraints. The constraints object specifies where a component's display area should be located on the grid and how the component should be positioned within its display area. In addition to its constraints object, the GridBagLayout also considers each component's minimum and preferred sizes in order to determine a component's size.
A flow layout lets each component assume its natural (preferred) size.
The components are laid out according to their preferred sizes and the constraints of the container's size. The NORTH and SOUTH components may be stretched horizontally; the EAST and WEST components may be stretched vertically; the CENTER component may stretch both horizontally and vertically to fill any space left over.
Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer,
Java EE6 Java Server Faces Developer.
SCJP, SCJD, SCWCD, OCPJBCD
Look! It's Leonardo da Vinci! And he brought a tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|