/** * Sets horizontal flex hint of this component. * <p>Number flex indicates how * this component's container distributes remaining empty space among its * children horizontally. Flexible component grow and shrink to fit their * given space. Flexible components with larger flex values will be made * larger than components with lower flex values, at the ratio determined by * all flexible components. The actual flex value is not relevant unless * there are other flexible components within the same container. Once the * default sizes of components in a container are calculated, the remaining * space in the container is divided among the flexible components, * according to their flex ratios.</p> * <p>Specify a flex value of negative value, 0, or "false" has the same * effect as leaving the flex attribute out entirely. * Specify a flex value of "true" has the same effect as a flex value of 1.</p> * <p>Special flex hint, <b>"min"</b>, indicates that the minimum space shall be * given to this flexible component to enclose all of its children components. * That is, the flexible component grow and shrink to fit its children components.</p> * @param flex horizontal flex hint of this component. * @since 5.0.0 * @see #setVflex * @see #getHflex */ public void setHflex(String flex) { if (getWidth() != null && !(flex == null || "min".equals(flex))) { throw new UiException("Not allowed to set hflex and width at the same time except hflex=\"min\""); } setHflex0(flex); }