import java.awt.ComponentOrientation; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class MainFlowLayout extends JPanel { public MainFlowLayout() { super(new FlowLayout(FlowLayout.LEADING, 10, 3)); this.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); add(new JButton("Hunden")); add(new JButton("Katten")); add(new JButton("Hesten")); add(new JButton("Giraffen")); } public static void main(String[] args) { JFrame frame = new JFrame(); frame.add(new MainFlowLayout()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(150, 200); frame.setVisible(true); } }