package devopsdistilled.operp.client.abstracts;

import javax.swing.JComponent;
import javax.swing.JDialog;

import net.miginfocom.swing.MigLayout;

public abstract class SubTaskPane {
	protected JDialog dialog;
	protected JComponent owner;

	public SubTaskPane() {
		dialog = new JDialog();
	}

	public abstract JComponent getPane();

	public void setOwner(JComponent owner) {
		this.owner = owner;
	}

	public JDialog getDialog() {
		dialog.getContentPane().setLayout(new MigLayout("debug"));
		dialog.getContentPane().add(getPane());
		dialog.setLocationRelativeTo(owner);
		dialog.setSize(400, 600);
		dialog.setVisible(true);
		return dialog;
	}

}

@@ -483,16 +483,22 @@
 t(%22debug
+, fill
 %22));%0A%09%09d
@@ -533,16 +533,24 @@
 etPane()
+, %22grow%22
 );%0A%09%09dia

Set components to grow inside to fill JDialog ContentPane