A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.oracle.com/en/java/javase/19/docs/api/java.desktop/java/awt/FlowLayout.html below:

FlowLayout (Java SE 19 & JDK 19)

All Implemented Interfaces:
LayoutManager, Serializable

A flow layout arranges components in a directional flow, much like lines of text in a paragraph. The flow direction is determined by the container's

componentOrientation

property and may be one of two values:

Flow layouts are typically used to arrange buttons in a panel. It arranges buttons horizontally until no more buttons fit on the same line. The line alignment is determined by the

align

property. The possible values are:

For example, the following picture shows an applet using the flow layout manager (its default layout manager) to position three buttons:

Here is the code for this applet:

 import java.awt.*;
 import java.applet.Applet;

 public class myButtons extends Applet {
     Button button1, button2, button3;
     public void init() {
         button1 = new Button("Ok");
         button2 = new Button("Open");
         button3 = new Button("Close");
         add(button1);
         add(button2);
         add(button3);
     }
 }
 

A flow layout lets each component assume its natural (preferred) size.

Since:
1.0
See Also:

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4