



"When Frame can't display all components, we naturally think of using scrollPane. In the comments of this article, watermelon_csdn mentioned: Feature two, increase the horizontalAlignment variable, which can control the horizontal alignment of the child controls in the container: horizontally left, center, and right.ģ. Add two variables topVerticalGap and bottomVerticalGap, which can separately control the margins between the sub-controls in the layout and the top and bottom of the container.Ģ. When the height of the child control collection exceeds the height of the container, although the child controls that go beyond are often invisible to the naked eye, they are actually placed in the first row of the container in a horizontal flow layout, which violates The definition of the vertical flow layout (because when the horizontal filling is turned on, the sub-controls that go beyond are not visible to the naked eye, so in most cases, the problem can be basically ignored, but when the container is turned off, the The problem will be exposed).ĭecided to rewrite MyVFlowLayout.java, in addition to solving the bug, two new features were added.ġ. In addition, there is a bug in the layout. , Cannot be set separately, and cannot meet the needs of use. They are uniformly controlled by a variable called vGap.
JAVA FLOWLAYOUT VERTICAL CODE
Some, plan to adjust the margin between the child control and the top of the container and the margin at the bottom of the container smaller.Īfter checking the source code of the vertical flow layout MyVFlowLayout.java, it is found that the margins between the child controls and the top of the container and the margins at the bottom of the container in the layout are the same as the vertical margins between the child controls. The margins between the sub-controls and the top of the container and the bottom of the container are larger than the margins between the subspace and the left and right sides of the container.
JAVA FLOWLAYOUT VERTICAL SOFTWARE
Recently, the original software has been optimized for some UI, which involves the use of vertical flow layout.
