Παράδειγμα διάταξης FlowLayout

java.awt.FlowLayout

import javax.swing.JFrame;
import javax.swing.JButton;

import java.awt.FlowLayout;

public class FlowLayoutDemo {
    public static void main(String[] args) {
        JFrame jf = new JFrame("Hello, World!");
        
        jf.setBounds(0, 0, 800, 600);
        
        jf.setLayout(new FlowLayout());
        jf.add(new JButton("button 1"));
        jf.add(new JButton("button 2"));
        jf.add(new JButton("button 3"));
        
        // Remember, the method show() is deprecated
        jf.setVisible(true);
    }
}