/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package genealogy;
import javax.swing.JOptionPane;
/**
*
* @author Jake
*/
public class FamilyCreation {
public FamilyCreation(){
int iter = 0;
boolean loop = false;
int totalMembers = 0;
int num = 0;
String choiceOne, choiceTwo, choiceThree, choiceFour;
while (loop == false){
if (iter == 0){
String s = (String)JOptionPane.showInputDialog(null,"Enter Family Name: ",
"Family Creation",JOptionPane.PLAIN_MESSAGE);
String familyName = s;
iter++;
System.out.println(s);
}
if (iter == 1) {
String s = (String)JOptionPane.showInputDialog(null, "Enter Number of Family Members: (Maximum of Four) "
, "Family Creation", JOptionPane.PLAIN_MESSAGE);
totalMembers = Integer.parseInt(s);
System.out.println(s);
iter++;
}
if(iter == 2){
while(num != totalMembers){
if(num == 1){
Object[] possibilities =
{"Select a choice", "Mother", "Father", "Son", "Daughter"};
String s = (String)JOptionPane.showInputDialog(
null,
"Choose type of member: ",
"Family Creation",
JOptionPane.PLAIN_MESSAGE,
null,
possibilities,
"Select a choice");
System.out.println(s);
choiceOne = s;
num++;}
if(num == 2){
Object[] possibilities =
{"Select a choice", "Mother", "Father", "Son", "Daughter"};
String s = (String)JOptionPane.showInputDialog(
null,
"Choose type of member: ",
"Family Creation",
JOptionPane.PLAIN_MESSAGE,
null,
possibilities,
"Select a choice");
System.out.println(s);
choiceTwo = s;
num++;}
if(num == 3){
Object[] possibilities =
{"Select a choice", "Mother", "Father", "Son", "Daughter"};
String s = (String)JOptionPane.showInputDialog(
null,
"Choose type of member: ",
"Family Creation",
JOptionPane.PLAIN_MESSAGE,
null,
possibilities,
"Select a choice");
System.out.println(s);
choiceThree = s;
num++;}
if(num == 4){
Object[] possibilities =
{"Select a choice", "Mother", "Father", "Son", "Daughter"};
String s = (String)JOptionPane.showInputDialog(
null,
"Choose type of member: ",
"Family Creation",
JOptionPane.PLAIN_MESSAGE,
null,
possibilities,
"Select a choice");
System.out.println(s);
choiceFour = s;
num++;
}
iter++;
}
}
}
}
} |