10.4 Using Layout Manager 1 (flowlayout)

Source: Internet
Author: User

1), FlowLayout Manager

It is the default layout manager class for panels that, when used, arranges components in the same way that the English words are arranged in the page: from left to right, the current row has no space and then goes to the next line.

When you add a component to a frame, you can use the following code example to invoke a floating layout:

FlowLayout layout = new FlowLayout ();

SetLayout (layout);

You can also specify a layout manager for a specific container, such as a Jpanle object, to use the SetLayout () method of the Container object.

The FlowLayout class arranges components only according to the size of the container. When the application window is resized, the components are rearranged immediately. By increasing the width of the window to twice times the original, all JButton components are found to be displayed on the same line.

10.4 Using Layout Manager 1 (flowlayout)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.