package net.oryanmat.gui.util.layout;

import javax.swing.*;
import java.awt.*;

@SuppressWarnings("UnusedDeclaration")
public class FlowLayoutBuilder<T extends JPanel> {
	private T panel;

	@SuppressWarnings("MagicConstant")
	protected FlowLayoutBuilder(T panel, int align, int horizontalGap, int verticalGap) {
		this.panel = panel;
		this.panel.setLayout(new FlowLayout(align, horizontalGap, verticalGap));
	}

	public T getPanel() {
		return this.panel;
	}

	public FlowLayoutBuilder<T> add(Component... components) {
		for (Component component : components) {
			this.panel.add(component);
		}

		return this;
	}
}

@@ -36,30 +36,8 @@
 t;%0A%0A
-import javax.swing.*;%0A
 impo
@@ -136,14 +136,17 @@
 nds 
-JPanel
+Container
 %3E %7B%0A
@@ -156,21 +156,25 @@
 ivate T 
-panel
+container
 ;%0A%0A%09@Sup
@@ -235,21 +235,25 @@
 ilder(T 
-panel
+container
 , int al
@@ -306,21 +306,29 @@
 his.
-panel = panel
+container = container
 ;%0A%09%09
@@ -332,21 +332,25 @@
 %0A%09%09this.
-panel
+container
 .setLayo
@@ -425,13 +425,17 @@
  get
-Panel
+Container
 () %7B
@@ -449,21 +449,25 @@
 rn this.
-panel
+container
 ;%0A%09%7D%0A%0A%09p
@@ -579,13 +579,17 @@
 his.
-panel
+container
 .add

replace JPanel with Container