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

java.awt.BorderLayout

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

import java.awt.BorderLayout;

public class BorderLayoutDemo {
    public static void main(String[] args) {
        JFrame jf = new JFrame("Hello, World!");
        
        jf.setBounds(0, 0, 800, 600);
        
        jf.setLayout(new BorderLayout());
        jf.add(new JButton("north"), BorderLayout.NORTH);
        jf.add(new JButton("south"), BorderLayout.SOUTH);
        jf.add(new JButton("center"), BorderLayout.CENTER);
        jf.add(new JButton("west"), BorderLayout.WEST);
        jf.add(new JButton("east"), BorderLayout.EAST);
        
        // Remember, the method show() is deprecated
        jf.setVisible(true);
    }
}