package gui;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;


/**
 * 
 * @author jasonfortunato
 * @author linneasahlberg
 */
public class MutationPane extends EvoPane {

	JLabel mutLabel,					// Mutation (0 to 1)
		mutAtoBLabel, mutBtoALabel;
	JTextField mutAtoB, mutBtoA;
	
	public MutationPane(){
		
		super();
		
		// Mutation (0 to 1)
		mutLabel = new JLabel("Mutation (0 to 1): ");
		mutAtoBLabel = new JLabel("A to B: ");
		mutBtoALabel = new JLabel("B to A: ");
		mutAtoB = new JTextField(TEXT_LEN_SHORT);
		mutBtoA = new JTextField(TEXT_LEN_SHORT);
		
		c.gridx = 0; c.gridy = 1;
		c.anchor = GridBagConstraints.WEST;
		add(mutLabel, c);
		
		// add label then field x3
		c.gridx = 1; c.gridy = 2;
		c.gridwidth = 1;
		c.anchor = GridBagConstraints.CENTER;
		add(mutAtoBLabel, c);
		c.gridx = 1;
		c.anchor = GridBagConstraints.EAST;
		add(mutAtoB, c);
	
		c.gridx = 2;
		c.anchor = GridBagConstraints.CENTER;
		add(mutBtoALabel, c);
		c.gridx = 2;
		c.anchor = GridBagConstraints.EAST;
		add(mutBtoA, c);
		
	}

	
	public static void main(String[] args){
		JFrame window = new JFrame();
		
		MutationPane test = new MutationPane();
		
		window.add(test);
		window.pack();
		window.setVisible(true);
		
	}

}

package gui;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import shared.Allele;


/**
 * 
 * @author jasonfortunato
 * @author linneasahlberg
 */
public class MutationPane extends EvoPane {

	JLabel mutLabel,					// Mutation (0 to 1)
		mutAtoBLabel, mutBtoALabel;
	JTextField mutAtoB, mutBtoA;
	
	public MutationPane(){
		
		super();
		
		// Mutation (0 to 1)
		mutLabel = new JLabel("Mutation (0 to 1): ");
		mutAtoBLabel = new JLabel("A to B: ");
		mutBtoALabel = new JLabel("B to A: ");
		mutAtoB = new JTextField(TEXT_LEN_SHORT);
		mutBtoA = new JTextField(TEXT_LEN_SHORT);
		
		c.gridx = 0; c.gridy = 1;
		c.anchor = GridBagConstraints.WEST;
		add(mutLabel, c);
		
		// add label then field x3
		c.gridx = 1; c.gridy = 2;
		c.gridwidth = 1;
		c.anchor = GridBagConstraints.CENTER;
		add(mutAtoBLabel, c);
		c.gridx = 1;
		c.anchor = GridBagConstraints.EAST;
		add(mutAtoB, c);
	
		c.gridx = 2;
		c.anchor = GridBagConstraints.CENTER;
		add(mutBtoALabel, c);
		c.gridx = 2;
		c.anchor = GridBagConstraints.EAST;
		add(mutBtoA, c);
		
	}

	public void submit(shared.SessionParameters p) {
		p.setMutationRate(Allele.A, Allele.B, Double.parseDouble(mutAtoB.getText()));
		p.setMutationRate(Allele.B, Allele.A, Double.parseDouble(mutBtoA.getText()));
	}
	
	public static void main(String[] args){
		JFrame window = new JFrame();
		
		MutationPane test = new MutationPane();
		
		window.add(test);
		window.pack();
		window.setVisible(true);
		
	}

}

Set up MutationPane with sesh parms