//	ED Character Generator
//	by Michael Swiernik
//	March 24, 1996
//	Version 1.0
//	Future revisions:
//		-Add Armor
//		-Add Weapons
//		-Possibly add Spells
// Modifier 13 Apr 2000 by Brian Sniffen to fix some problems with the Swordmaster

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class CharacterCreator extends Applet
    implements ActionListener, ItemListener  {
    
    TextField name;
    Choice disc;
    Choice race;
    Choice circ;
    Choice dex, str, tou, per, wil, cha;
    List tal1, tal2, tal3, tal4, tal5, tal6, tal7, tal8, tal9, tal10, tal11,
	tal12, tal13, tal14, tal15;
    //List[] tals;
    Button incr, decr;
    TextField dexs, strs, tous, pers, wils, chas;
    TextField dexm, strm, toum, perm, wilm, cham;
    TextField defph, defsp, defso;
    TextField armp, armm;
    TextField movf, movc;
    TextField strc, strl;
    TextField inits, initf, initd;
    TextField dth, unc, wnd, rec, recd;
    TextField karc, karm, karcst, kard, karmod;
    TextField legt, legc, legs, legm;
    TextField attPts, talPts;
    
    int[][] attMods = {
	{1, 0, -2, 0, 1, 3, 1}, //Blood Elf
	{0, 2, 3, 0, 0, -2, -2},  //Dwarf
	{2, 0, -2, 1, 1, 1, 1},  //Elf
	{0, 0, 0, 0, 0, 0, 0},   //Human
	{0, 2, 1, -2, 1, -2, 1},  //Jackalman
	{-1, -2, -1, 2, 1, -1, -1},  //Jubruq
	{-1, -1, 2, 0, 0, 1, -1},  //Leafer
	{-2, 6, 4, -1, 0, -1, -3},  //Obsidiman
	{-1, 3, 1, 0, -2, -1, 2},  //Ork
	{0, 4, 2, -1, 1, 0, 0},  //Troll
	{1, 0, 1, 0, 0, 1, 0},   //T'skrang
	{-1, 2, 3, -1, 0, -2, -2},  //Ulk-man
	{1, -4, -3, 1, 0, 2, 2}, //Windling
    };
    
    //	Arrays for holding the data.
    String[][] attSteps = {
	{"1", "2"}, {"2", "2"}, {"3", "2"}, {"4", "3"}, {"5", "3"}, 
	{"6", "3"}, {"7", "4"}, {"8", "4"}, {"9", "4"}, {"10", "5"}, 
	{"11", "5"}, {"12", "5"}, {"13", "6"}, {"14", "6"}, {"15", "6"}, 
	{"16", "7"}, {"17", "7"}, {"18", "7"}, {"19", "8"}, {"20", "8"}, 
	{"21", "8"}, {"22", "9"}, {"23", "9"}, {"24", "9"}, {"25", "10"}, 
	{"26", "10"}, {"27", "10"}, {"28", "11"}, {"29", "11"}, {"30", "11"}
    };
    
    
    String[][] attCst = {
	{"2", "3"}, {"3", "2"}, {"4", "1"}, {"5", "0"}, 
	{"6", "-1"}, {"7", "-2"}, {"8", "-3"}, {"9", "-4"}, {"10", "-5"}, 
	{"11", "-6"}, {"12", "-8"}, {"13", "-10"}, {"14", "-13"}, {"15", "-16"}, 
	{"16", "-19"}, {"17", "-21"}, {"18", "-23"}
    };
    
    
    String[][] defenses = {
	{"1", "2"}, {"2", "3"}, {"3", "3"}, {"4", "4"}, {"5", "4"}, 
		{"6", "4"}, {"7", "5"}, {"8", "5"}, {"9", "6"}, {"10", "6"}, 
	{"11", "7"}, {"12", "7"}, {"13", "7"}, {"14", "8"}, {"15", "8"}, 
	{"16", "9"}, {"17", "9"}, {"18", "10"}, {"19", "10"}, {"20", "10"}, 
	{"21", "11"}, {"22", "11"}, {"23", "12"}, {"24", "12"}, {"25", "13"}, 
	{"26", "13"}, {"27", "13"}, {"28", "14"}, {"29", "14"}, {"30", "15"}
    };
    
    
    String[][] armors = {
	{"1", "0"}, {"2", "0"}, {"3", "0"}, {"4", "0"}, {"5", "0"}, 
	{"6", "0"}, {"7", "0"}, {"8", "0"}, {"9", "0"}, {"10", "0"}, 
	{"11", "1"}, {"12", "1"}, {"13", "1"}, {"14", "2"}, {"15", "2"}, 
	{"16", "2"}, {"17", "3"}, {"18", "3"}, {"19", "3"}, {"20", "4"}, 
	{"21", "4"}, {"22", "4"}, {"23", "5"}, {"24", "5"}, {"25", "5"}, 
	{"26", "6"}, {"27", "6"}, {"28", "6"}, {"29", "7"}, {"30", "7"}
    };
    
    
    String[][] moveFull = {
	{"1", "25"}, {"2", "28"}, {"3", "30"}, {"4", "32"}, {"5", "35"}, 
	{"6", "38"}, {"7", "40"}, {"8", "43"}, {"9", "48"}, {"10", "50"}, 
	{"11", "54"}, {"12", "57"}, {"13", "60"}, {"14", "65"}, {"15", "70"}, 
	{"16", "75"}, {"17", "80"}, {"18", "85"}, {"19", "90"}, {"20", "100"}, 
	{"21", "110"}, {"22", "120"}, {"23", "130"}, {"24", "140"}, {"25", "150"}, 
	{"26", "160"}, {"27", "170"}, {"28", "180"}, {"29", "200"}, {"30", "220"}
    };
    
    String[][] moveCom = {
	{"1", "13"}, {"2", "14"}, {"3", "15"}, {"4", "16"}, {"5", "18"}, 
	{"6", "19"}, {"7", "20"}, {"8", "22"}, {"9", "24"}, {"10", "25"}, 
	{"11", "27"}, {"12", "29"}, {"13", "30"}, {"14", "33"}, {"15", "35"}, 
	{"16", "38"}, {"17", "40"}, {"18", "42"}, {"19", "45"}, {"20", "50"}, 
	{"21", "55"}, {"22", "60"}, {"23", "65"}, {"24", "70"}, {"25", "75"}, 
	{"26", "80"}, {"27", "85"}, {"28", "90"}, {"29", "100"}, {"30", "110"}
    };
    
    String[][] strCarry = {
	{"1", "10"}, {"2", "15"}, {"3", "20"}, {"4", "25"}, {"5", "30"}, 
	{"6", "35"}, {"7", "40"}, {"8", "50"}, {"9", "60"}, {"10", "70"}, 
	{"11", "80"}, {"12", "90"}, {"13", "105"}, {"14", "125"}, {"15", "145"}, 
	{"16", "165"}, {"17", "200"}, {"18", "230"}, {"19", "270"}, {"20", "315"}, 
	{"21", "360"}, {"22", "430"}, {"23", "500"}, {"24", "580"}, {"25", "675"}, 
	{"26", "790"}, {"27", "920"}, {"28", "1075"}, {"29", "1200"}, {"30", "1450"}
    };
    
    String[][] strLift = {
	{"1", "20"}, {"2", "30"}, {"3", "40"}, {"4", "50"}, {"5", "65"}, 
	{"6", "75"}, {"7", "85"}, {"8", "100"}, {"9", "115"}, {"10", "135"}, 
	{"11", "160"}, {"12", "185"}, {"13", "210"}, {"14", "250"}, {"15", "290"}, 
	{"16", "310"}, {"17", "400"}, {"18", "460"}, {"19", "540"}, {"20", "630"}, 
	{"21", "735"}, {"22", "860"}, {"23", "1000"}, {"24", "1160"}, {"25", "1350"}, 
	{"26", "1580"}, {"27", "1840"}, {"28", "2150"}, {"29", "2500"}, {"30", "2900"}
    };
    
    String[][] dthRat = {
	{"1", "19"}, {"2", "20"}, {"3", "22"}, {"4", "23"}, {"5", "24"}, 
	{"6", "26"}, {"7", "27"}, {"8", "28"}, {"9", "30"}, {"10", "31"}, 
	{"11", "32"}, {"12", "34"}, {"13", "35"}, {"14", "36"}, {"15", "38"}, 
	{"16", "39"}, {"17", "40"}, {"18", "42"}, {"19", "43"}, {"20", "44"}, 
	{"21", "46"}, {"22", "47"}, {"23", "48"}, {"24", "50"}, {"25", "51"}, 
	{"26", "52"}, {"27", "54"}, {"28", "55"}, {"29", "56"}, {"30", "58"}
    };
    
    String[][] uncRat = {
	{"1", "10"}, {"2", "11"}, {"3", "13"}, {"4", "14"}, {"5", "15"}, 
	{"6", "17"}, {"7", "18"}, {"8", "19"}, {"9", "21"}, {"10", "22"}, 
	{"11", "24"}, {"12", "26"}, {"13", "27"}, {"14", "28"}, {"15", "29"}, 
	{"16", "31"}, {"17", "32"}, {"18", "34"}, {"19", "35"}, {"20", "36"}, 
	{"21", "39"}, {"22", "40"}, {"23", "41"}, {"24", "43"}, {"25", "44"}, 
	{"26", "45"}, {"27", "47"}, {"28", "48"}, {"29", "49"}, {"30", "51"}
    };
    
    String[][] wndThr = {
	{"1", "3"}, {"2", "4"}, {"3", "4"}, {"4", "5"}, {"5", "5"}, 
	{"6", "6"}, {"7", "6"}, {"8", "7"}, {"9", "7"}, {"10", "8"}, 
	{"11", "8"}, {"12", "9"}, {"13", "9"}, {"14", "10"}, {"15", "10"}, 
	{"16", "11"}, {"17", "11"}, {"18", "12"}, {"19", "12"}, {"20", "13"}, 
	{"21", "13"}, {"22", "13"}, {"23", "14"}, {"24", "14"}, {"25", "15"}, 
	{"26", "15"}, {"27", "15"}, {"28", "16"}, {"29", "16"}, {"30", "17"}
    };
    
    String[][] recTsts = {
	{"1", "0.5"}, {"2", "0.5"}, {"3", "1"}, {"4", "1"}, {"5", "1"}, 
	{"6", "1"}, {"7", "1"}, {"8", "2"}, {"9", "2"}, {"10", "2"}, 
	{"11", "2"}, {"12", "2"}, {"13", "2"}, {"14", "3"}, {"15", "3"}, 
	{"16", "3"}, {"17", "3"}, {"18", "3"}, {"19", "3"}, {"20", "4"}, 
	{"21", "4"}, {"22", "4"}, {"23", "4"}, {"24", "4"}, {"25", "4"}, 
	{"26", "5"}, {"27", "5"}, {"28", "5"}, {"29", "5"}, {"30", "5"}
    };
	
    String[][] karMax = {
	{"Dwarf", "25"}, {"Blood Elf", "25"}, {"Elf", "25"}, {"Human", "40"},
	{"Jackalman", "35"}, {"Jubruq", "70"}, {"Leafer", "35"}, {"Obsidiman", "20"}, 
	{"Ork", "40"}, {"Troll", "20"}, {"T\'skrang", "25"}, {"Ulk-man", "20"}, {"Windling", "60"}
    };
    
    String[][] karCst = {
	{"Dwarf", "10"}, {"Blood Elf", "10"}, {"Elf", "10"}, {"Human", "6"}, 
	{"Jackalman", "10"}, {"Jubruq", "5"}, {"Leafer", "7"}, {"Obsidiman", "10"}, 
	{"Ork", "7"}, {"Troll", "10"}, {"T\'skrang", "8"}, {"Ulk-man", "12"}, {"Windling", "5"}
    };
    
    String[][] karDie = {
	{"Dwarf", "D6"}, {"Blood Elf", "D6"}, {"Elf", "D6"}, {"Human", "D8"}, 
	{"Jackalman", "D8"}, {"Jubruq", "D10"}, {"Leafer", "D8"}, {"Obsidiman", "D4"}, 
	{"Ork", "D8"}, {"Troll", "D4"}, {"T\'skrang", "D6"}, {"Ulk-man", "D4"}, {"Windling", "D10"}
    };	
    
    String[][] karStart = {
	{"Dwarf", "6"}, {"Blood Elf", "5"}, {"Elf", "5"}, {"Human", "10"}, 
	{"Jackalman", "8"}, {"Jubruq", "15"}, {"Leafer", "5"}, {"Obsidiman", "5"}, 
	{"Ork", "10"}, {"Troll", "6"}, {"T\'skrang", "5"}, {"Ulk-man", "5"}, {"Windling", "15"}
    };
    
    String[][] OneTals = {
	{"Air Sailor", "Acrobatic Strike", "Air Sailing", "Avoid Blow", "Karma Ritual", "Melee Weapons", "Unarmed Combat"}, 
	{"Archer", "Avoid Blow", "Direction Arrow", "Karma Ritual", "Missile Weapons", "Mystic Aim", "True Shot"}, 
	{"Beastmaster", "Animal Bond", "Claw Shape", "Dominate Beast", "Karma Ritual", "Tracking", "Unarmed Combat"}, 
	{"Boatman", "Avoid Blow", "Karma Ritual", "Melee Weapon", "Pilot Boat", "Throwing Weapons", "Unarmed Combat"}, 
	{"Cavalryman", "Animal Bond", "Avoid Blow", "Charge", "Karma Ritual", "Melee Weapons", "Trick Riding"}, 
	{"Elementalist", "Karma Ritual", "Read and Write Language", "Read and Write Magic", "Spellcasting", "Spell Matrix", "Spell Matrix", "Thread Weaving"}, 
	{"Horror Stalker", "Astral Sight", "Karma Ritual", "Melee Weapons", "Silent Walk", "Steel Thought", "Tracking"},
	{"Hunter", "Avoid Blow", "Animal Bond", "Karma Ritual", "Missile Weapons", "Prey Link", "Tracking"}, 
	{"Illusionist", "Karma Ritual", "Read and Write Language", "Read and Write Magic", "Spellcasting", "Spell Matrix", "Spell Matrix", "Thread Weaving"}, 
	{"Liberator", "Freedom Search", "Karma Ritual", "Melee Weapons", "Mind Armor", "Mind Blade", "Ritual of Atonement"},
	{"Nethermancer", "Karma Ritual", "Read and Write Language", "Read and Write Magic", "Spellcasting", "Spell Matrix", "Spell Matrix", "Thread Weaving"}, 
	{"Outcast Warrior", "Avoid Blow", "Battle Shout", "Karma Ritual", "Melee Weapons", "Taunt", "Unarmed Combat"}, 
	{"Purifier", "Astral Sight", "Battle Shout", "Body Control", "Karma Ritual", "Unarmed Combat", "Wound Balance"}, 
	{"Scout", "Avoid Blow", "Climbing", "Karma Ritual", "Melee Weapons", "Silent Walk", "Tracking"}, 
	{"Shaman", "Create Fetish", "Karma Ritual", "Learn Spell Pattern", "Thread Weaving", "Spell Fetish", "Spell Fetish", "Spellcasting"}, 
	{"Sky Raider", "Air Sailing", "Avoid Blow", "Battle Shout", "Fireblood", "Karma Ritual", "Melee Weapons"}, 
	{"Swordmaster", "Avoid Blow", "Karma Ritual", "Maneuver", "Melee Weapons", "Taunt", "Wound Balance"}, 
	{"Thief", "Climbing", "Karma Ritual", "Lock Pick", "Melee Weapons", "Picking Pockets", "Silent Walk", "Surprise Strike"}, 
	{"Traveled Scholar", "Karma Ritual", "Melee Weapons", "Read and Write Language", "Read and Write Magic", "Steel Thought", "Weapon History"}, 
	{"Troubadour", "Disguise", "Emotion Song", "First Impression", "Karma Ritual", "Melee Weapons", "Mimic Voice"}, 
	{"Warrior", "Acrobatic Strike", "Air Dance", "Karma Ritual", "Melee Weapons", "Unarmed Combat", "Wood Skin"}, 
	{"Weaponsmith", "Avoid Blow", "Forge Blade", "Karma Ritual", "Melee Weapons", "Steel Thought", "Weapon History"}, 
	{"Wind-Dancer", "Insect Communication", "Karma Ritual", "Mimic Voice", "Read and Write Language", "Speak Language", "Wind Dance"}, 
	{"Windmaster", "Avoid Blow", "Dive Attack", "Karma Ritual", "Melee Weapons", "Throwing Weapons", "Unarmed Combat"}, 
	{"Windscout", "Air Dance", "Avoid Blow", "Karma Ritual", "Melee Weapons", "Missile Weapons", "Silent Walk"}, 
	{"Wizard", "Karma Ritual", "Read and Write Language", "Read and Write Magic", "Spellcasting", "Spell Matrix", "Spell Matrix", "Thread Weaving"}, 
	{"Woodsman", "Avoid Blow", "Karma Ritual", "Melee Weapons", "Missile Weapons", "Silent Walk", "Tracking"},
    };
    
    String[][] TwoTals = {
	{"Air Sailor", "Durability", "Great Leap", "Maneuver"}, 
	{"Archer", "Durability", "Sprint", "Throwing Weapons"}, 
	{"Beastmaster", "Animal Training", "Creature Analysis", "Durability"}, 
	{"Boatman", "Acrobatic Strike", "Durability", "Read River"}, 
	{"Cavalryman", "Blood Share", "Durability", "Empathic Command"}, 
	{"Elementalist", "Durability", "Fire Heal", "Spell Matrix"}, 
	{"Horror Stalker", "Durability", "Evidence Analysis", "Deathstrike"},
	{"Hunter", "Animal Training", "Durability", "Prey Presence"}, 
	{"Illusionist", "Disguise Self", "Durability", "Spell Matrix"}, 
	{"Liberator", "Durability", "Free Mind", "Unarmed Combat"}, 
	{"Nethermancer", "Astral Sight", "Durability", "Frighten"}, 
	{"Outcast Warrior", "Anticipate Blow", "Durability", "Shield Charge"}, 
	{"Purifier", "Creature Analysis", "Durability", "Fire Blood"}, 
	{"Scout", "Durability", "Maneuver", "Read and Write Language"}, 
	{"Shaman", "Astral Sight", "Durability", "Spell Fetish"}, 
	{"Sky Raider", "Durability", "Great Leap", "Shield Charge"}, 
	{"Swordmaster", "Durability", "Parry", "Winning Smile"}, // was Riposte, Throwing Weapons
	{"Thief", "Durability", "Lock Sense"}, 
	{"Traveled Scholar", "Durability", "Item History", "Speak Language"}, 
	{"Troubadour", "Durability", "Item History", "Speak Language"}, 
	{"Warrior", "Anticipate Blow", "Durability", "Throwing Weapons"}, 
	{"Weaponsmith", "Durability", "Haggle", "Read and Write Language"}, 
	{"Wind-Dancer", "Durability", "Item History", "Winning Smile"}, 
	{"Windmaster", "Anticipate Blow", "Durability", "Taunt"}, 
	{"Windscout", "Air Tracking", "Anticipate Blow", "Durability"}, 
	{"Wizard", "Durability", "Evidence Analysis", "Spell Matrix"},
	{"Woodsman", "Animal Training", "Climbing", "Durability"}
    };
    
    String[][] ThreeTals = {
	{"Air Sailor", "Riposte", "Wind Catcher"}, 
	{"Archer", "Flame Arrow", "Wound Balance"}, 
	{"Beastmaster", "Borrow Sense", "Cat\'s Paw"}, 
	{"Boatman", "Cast Net", "Haggle"}, 
	{"Cavalryman", "Spirit Mount", "Wheeling Attack"}, 
	{"Elementalist", "Air Speaking", "Elemental Tongues"}, 
	{"Horror Stalker", "Bear Mark", "Empathic Sense"},
	{"Hunter", "Climbing", "Evidence Analysis"}, 
	{"Illusionist", "Dead Fall", "Speak Language"}, 
	{"Liberator", "Heart of Freedom", "Shackle Shrug"}, 
	{"Nethermancer", "Spell Matrix", "Taunt"}, 
	{"Outcast Warrior", "Swift Kick", "Throwing Weapons"}, 
	{"Purifier", "Elemental Tongues", "Swift Kick"}, 
	{"Scout", "Astral Sight", "Sprint"}, 
	{"Shaman", "Elemental Tongues", "Melee Weapons"}, // Was Avoid Blow
	{"Sky Raider", "Swift Kick", "Wind Catcher"}, 
	{"Swordmaster", "Heartening Laugh", "Riposte"}, // was Missile Weapons
	{"Thief", "Avoid Blow", "Fence"}, 
	{"Traveled Scholar", "Astral Sight", "Book Memory"}, 
	{"Troubadour", "Empathic Sense", "Read and Write Language"}, 
	{"Warrior", "Avoid Blow", "Tiger Spring"}, 
	{"Weaponsmith", "Abate Curse", "Detect Weapon"}, 
	{"Wind-Dancer", "Cat\'s Paw", "Melee Weapons"}, 
	{"Windmaster", "Detect Weapon", "Wood Skin"}, 
	{"Windscout", "Down Strike", "Maneuver"}, 
	{"Wizard", "Book Memory", "Book Recall"},
	{"Woodsman", "Borrow Sense", "Sprint"}
    };
    
    String[][] FourTals = {
	{"Air Sailor", "Thread Weaving", "Throwing Weapons"}, 
	{"Archer", "Melee Weapons", "Thread Weaving"}, 
	{"Beastmaster", "Frighten Animal Servants", "Thread Weaving"}, 
	{"Boatman", "Mystic Aim (Thrown)", "Thread Weaving"}, 
	{"Cavalryman", "Resist Taunt", "Thread Weaving"}, 
	{"Elementalist", "Elemental Hold", "Spell Matrix"}, 
	{"Horror Stalker", "Thread Weaving", "Willforce"},
	{"Hunter", "Silent Walk", "Thread Weaving"}, 
	{"Illusionist", "False Sight", "Spell Matrix"}, 
	{"Liberator", "False Shackles", "Thread Weaving"}, 
	{"Nethermancer", "Spell Matrix", "Willforce"}, 
	{"Outcast Warrior", "Fireblood", "Thread Weaving"}, 
	{"Purifier", "Clay Skin(Wood Skin)", "Thread Weaving"}, 
	{"Scout", "Riposte", "Thread Weaving"}, 
	{"Shaman", "Spirit Talk", "Spell Fetish"}, // Was Arc. Mutter.
	{"Sky Raider", "Thread Weaving", "Throwing Weapons"}, 
	{"Swordmaster", "Thread Weaving", "Trap Initiative"}, 
	{"Thief", "Thread Weaving", "Trap Initiative"}, 
	{"Traveled Scholar", "Book Recall", "Thread Weaving"}, 
	{"Troubadour", "Taunt", "Thread Weaving"}, 
	{"Warrior", "Down Strike", "Thread Weaving"}, 
	{"Weaponsmith", "Speak Language", "Thread Weaving"}, 
	{"Wind-Dancer", "Spellcasting", "Spell Matrix", "Thread Weaving"}, 
	{"Windmaster", "Thread Weaving", "Wind Dance"}, 
	{"Windscout", "Thread Weaving", "Tracking"}, 
	{"Wizard", "Arcane Mutterings", "Astral Sight"},
	{"Woodsman", "Thread Weaving", "Throwing Weapons"} 
    };
    
    String[][] FiveTals = {
	{"Air Sailor", "Air Dance", "Second Weapon"}, 
	{"Archer", "First Impression", "Stopping Aim"}, 
	{"Beastmaster", "Heal Animal Servant", "Incite Stampede"}, 
	{"Boatman", "Engaging Banter", "Evaluate"}, 
	{"Cavalryman", "Sure Mount", "Wheeling Defense"}, 
	{"Elementalist", "Cold Purify", "Willforce"}, 
	{"Horror Stalker", "Heartening Laugh", "Temper Self"},
	{"Hunter", "Astral Sight", "Terror Stalk"}, 
	{"Illusionist", "Anticipate Blow", "Willforce"}, 
	{"Liberator", "Lion Spirit", "Lock Pick"}, 
	{"Nethermancer", "Animal Possession", "Spirit Hold"}, 
	{"Outcast Warrior", "Battle Bellow", "Gliding Stride"}, 
	{"Purifier", "Battle Bellow", "Riposte"}, 
	{"Scout", "Lock Sense", "Trap Initiative"}, 
	{"Shaman", "Empathic Sense", "Willforce"}, 
	{"Sky Raider", "Battle Bellow", "Fence"}, 
	{"Swordmaster", "Second Weapon", "Cloak Attack"}, // Was Winning Smile 
	{"Thief", "Disarm Mechanical Trap", "Detect Trap"}, 
	{"Traveled Scholar", "Empathic Sense", "Evidence Analysis"}, 
	{"Troubadour", "Engaging Banter", "Throwing Weapons"}, 
	{"Warrior", "Gliding Strike", "Swift Kick"}, 
	{"Weaponsmith", "Temper Self", "Warp Missile"}, 
	{"Wind-Dancer", "Book Memory", "Read and Write Magic"}, 
	{"Windmaster", "Fast Grab", "Maneuver"}, 
	{"Windscout", "Battle Bellow", "Scent Identifier"}, 
	{"Wizard", "Lip Reading", "Willforce"},
	{"Woodsman", "Air Dance", "Claw Shape"}
    };
    
    String[][] SixTals = {
	{"Air Sailor", "Momentum Attack", "Taunt"}, 
	{"Archer", "Bank Shot", "Speak Language"}, 
	{"Beastmaster", "Endure Cold", "Lizard Leap"}, 
	{"Boatman", "Speak Language", "Lizard Leap"}, 
	{"Cavalryman", "Dominate Beast", "Durability(Mount)"}, 
	{"Elementalist", "Temperature", "Unshakable Earth"}, 
	{"Horror Stalker", "Life Check", "Missile Weapons"},
	{"Hunter", "Melee Weapons", "Surprise Strike"}, 
	{"Illusionist", "Enhanced Matrix", "Fast Hand"}, 
	{"Liberator", "Dead Fall", "Freedom Song"}, 
	{"Nethermancer", "Enhanced Matrix", "Spirit Talk"}, 
	{"Outcast Warrior", "Down Strike", "Steely Stare"}, 
	{"Purifier", "Life Check", "Unshakable Earth"}, 
	{"Scout", "Borrow Sense", "Great Leap"}, 
	{"Shaman", "Spirit Dodge", "Spell Fetish"}, // Was Endure Cold
	{"Sky Raider", "Momentum Attack", "Steely Stare"}, 
	{"Swordmaster", "Disarm", "Speak Language"}, 
	{"Thief", "Disguise", "Missile Weapons"}, 
	{"Traveled Scholar", "Avoid Blow", "Haggle"}, 
	{"Troubadour", "Haggle", "Resist Taunt"}, 
	{"Warrior", "Life Check", "Missile Weapons"}, 
	{"Weaponsmith", "Conceal Weapon", "Spot Armor Flaw"}, 
	{"Wind-Dancer", "Spirit Talk", "Throwing Weapons"}, 
	{"Windmaster", "Armor Bypass", "Disarm"}, 
	{"Windscout", "Dive Attack", "Bank Shot"}, 
	{"Wizard", "Enhanced Matrix", "Speak Language"},
	{"Woodsman", "Endure Cold", "Lizard Leap"}
    };
    
    String[][] SevenTals = {
	{"Air Sailor", "Missile Weapons", "Speak Language"}, 
	{"Archer", "Anticipate Blow", "Call Arrow"}, 
	{"Beastmaster", "Claw Frenzy", "Sense Poison"}, 
	{"Boatman", "First Impression", "Great Leap"}, 
	{"Cavalryman", "Lasting Impression", "Missile Weapons"}, 
	{"Elementalist", "Enhanced Matrix", "Reshape Object"}, 
	{"Horror Stalker", "Second Attack", "Spirit Dodge"}, 
	{"Hunter", "Lock Pick", "Sprint"}, 
	{"Illusionist", "Engaging Banter", "Enhanced Matrix"}, 
	{"Liberator", "Power Mask", "Shout of Justice"}, 
	{"Nethermancer", "Lifesight", "Spirit Dodge"}, 
	{"Outcast Warrior", "Disarm", "Missile Weapons"}, 
	{"Purifier", "Earth Skin", "Second Attack"}, 
	{"Scout", "Detect Trap", "Endure Cold"}, 
	{"Shaman", "Lifesight", "Beast Tongues"}, // was Sense Poison
	{"Sky Raider", "Missile Weapons", "Speak Language"},
	{"Swordmaster", "Resist Taunt", "Second Attack"}, 
	{"Thief", "Detect Weapon", "Throwing Weapons"}, 
	{"Traveled Scholar", "Engaging Banter", "First Impression"}, 
	{"Troubadour", "Incite Mob", "Missile Weapons"}, 
	{"Warrior", "Earth Skin", "Second Attack"}, 
	{"Weaponsmith", "Disarm", "Temper Other"}, 
	{"Wind-Dancer", "Endure Cold", "Lasting Impression"}, 
	{"Windmaster", "Air Dance", "Momentum Attack"}, 
	{"Windscout", "Sense Poison", "Throwing Weapons"}, 
	{"Wizard", "Hold Thread", "Melee Weapons"},
	{"Woodsman", "Earth Skin", "Second Attack"}
    };
	
    String[][] EightTals = {
	{"Air Sailor", "Anticipate Blow", "Crushing Blow"}, 
	{"Archer", "Called Shot", "Eagle Eye"}, 
	{"Beastmaster", "Lion Heart", "Poison Resistance"}, 
	{"Boatman", "Lion Heart", "Wound Balance"}, 
	{"Cavalryman", "Fearsome Charge", "Mount Attack"}, 
	{"Elementalist", "Enhanced Matrix", "Safe Path"}, 
	{"Horror Stalker", "Lion Heart", "Spirit Strike"},
	{"Hunter", "Borrow Sense", "Create Trap"}, 
	{"Illusionist", "Mind Wave", "True Sight"}, 
	{"Liberator", "Heart of Rebellion", "Prison Call"}, 
	{"Nethermancer", "Enhanced Matrix", "Orbiting Spy"}, 
	{"Outcast Warrior", "Crushing Blow", "Momentum Attack"}, 
	{"Purifier", "Crushing Blow", "Lion Heart"}, 
	{"Scout", "Gliding Stride", "Missile Weapons"}, 
	{"Shaman", "Enhanced Fetish", "Spirit Hold", "Safe Path"}, 
	{"Sky Raider", "Crushing Blow", "Unarmed Combat"}, 
	{"Swordmaster", "Anticipate Blow", "Engaging Banter"}, 
	{"Thief", "Conceal Weapon", "Wound Balance"}, 
	{"Traveled Scholar", "Arcane Mutterings", "Graceful Exit"}, 
	{"Troubadour", "Graceful Exit", "Hypnotize"}, 
	{"Warrior", "Cobra Strike", "Spirit Strike"}, 
	{"Weaponsmith", "Improve Blade", "Metal Ward"}, 
	{"Wind-Dancer", "Dive Attack", "Graceful Exit"}, 
	{"Windmaster", "Down Strike", "Fearsome Charge"}, 
	{"Windscout", "Eagle Eye", "Surprise Strike"}, 
	{"Wizard", "Enhanced Matrix", "Resist Taunt"},
	{"Woodsman", "Poison Resistance", "Wound Balance"}
    };
    
    String[][] NineTals = {
	{"Air Sailor", "Critical Hit", "Lion Heart", "Wound Balance"}, 
	{"Archer", "Impressive Shot", "Silent Walk", "Trace Missile"}, 
	{"Beastmaster", "Animal Possession", "Bestial Toughness", "Howl"}, 
	{"Cavalryman", "Call Mount", "Down Strike", "Rally"}, 
	{"Elementalist", "Armored Matrix", "Metal Ward", "Water Dancing"}, 
	{"Horror Stalker", "Bardic Voice", "Critical Hit", "Steely Stare"}, 
	{"Hunter", "Great Leap", "Safe Path", "Taunt"}, 
	{"Illusionist", "Armored Matrix", "Detect Falsehood", "Memorize Image"}, 
	{"Liberator", "Escape Divination", "Hoard Blows"}, 
	{"Nethermancer", "Arcane Mutterings", "Armored Matrix", "Astral Pocket"}, 
	{"Purifier", "Bestial Toughness", "Steel Thought", "Tiger Spring"}, 
	{"Scout", "Anticipate Blow", "Creature Analysis", "Detect Weapon"}, 
	{"Shaman", "Cat\'s Paw", "Enhanced Fetish", "Frighten"}, 
	{"Sky Raider", "Critical Hit", "Lion Heart", "Thunder Axe"}, 
	{"Swordmaster", "Piercing Strike", "Cobra Strike", "Pin"}, // Was Called Shot
	{"Thief", "Gold Sense", "Lip Reading", "Speak Language"}, 
	{"Traveled Scholar", "Lifesight", "Memorize Image", "Multi-Tongue"}, 
	{"Troubadour", "Bardic Voice", "Blade Juggle", "True Sight"}, 
	{"Warrior", "Cat\'s Paw", "Missile Twister", "Second Weapon"}, 
	{"Weaponsmith", "Read and Write Magic", "Sense Magic Weapon", "Show Armor Flaw"}, 
	{"Wind-Dancer", "Air Speaking", "Bardic Voice", "Impressive Shot"}, 
	{"Windmaster", "Fireblood", "Sense Magic Weapon"}, 
	{"Windscout", "Missile Twister", "Safe Path", "Unarmed Combat"}, 
	{"Wizard", "Armored Matrix", "Matrix Strike", "Range Pattern"},
	{"Woodsman", "Missile\'s Path (BE)", "Mystic Aim (BE)", "Second Weapon (BE)"}
    };
    
    String[][] TenTals = {
	{"Air Sailor", "Endure Cold", "Shield Beater"}, 
	{"Archer", "Dominate Arrow", "Rushing Attack"}, 
	{"Beastmaster", "Animal Leadership", "Lion Spirit"}, 
	{"Cavalryman", "Armor Mount", "Champion Challenge"}, 
	{"Elementalist", "Animate Object", "Plant Shelter"}, 
	{"Horror Stalker", "Confront Horror", "Lion Spirit"},
	{"Hunter", "Astral Track", "True Sight"},  
	{"Illusionist", "Missile Weapons", "Safe Thought"}, 
	{"Liberator", "Heal Slave", "Impossible Hide"}, 
	{"Nethermancer", "Summon", "Summoning Circle"}, 
	{"Purifier", "Body Blade", "Whirlwind"}, 
	{"Scout", "Missile Twister", "Trace Missile"}, 
	{"Shaman", "Enhanced Matrix", "Develop Animal Sense"}, // Was Matrix Strike 
	{"Sky Raider", "Endure Cold", "Shield Beater"}, 
	{"Swordmaster", "Critical Hit", "Whirlwind"}, 
	{"Thief", "Disarm Magical Trap", "Slough Blade"}, 
	{"Traveled Scholar", "Hypnotize", "Slough Blame"}, 
	{"Troubadour", "Multi-Tongue", "Slough Blame"}, 
	{"Warrior", "Body Blade", "Matrix Strike"}, 
	{"Weaponsmith", "Fireblood", "Spellcasting"}, 
	{"Wind-Dancer", "Multi-Tongue", "Slough Blame"}, 
	{"Windmaster", "Impressive Shot", "Whirlwind"}, 
	{"Windscout", "Acrobatic Strike", "Wood Skin"}, 
	{"Wizard", "Life Check", "Spirit Strike"},
	{"Woodsman", "Spirit Strike (BE)", "Woodspeak (BE)"}
    };
    
    String[][] ElevenTals = {
	{"Air Sailor", "Defense", "Weapon Breaker"}, 
	{"Archer", "Blind Fire", "Quick Shot"}, 
	{"Beastmaster", "Develop Animal Sense", "Tame Mount"}, 
	{"Cavalryman", "Heal Animal Servant", "Tame Mount"}, 
	{"Elementalist", "Summon", "Summoning Circle"}, 
	{"Illusionist", "Armored Matrix", "Thoughtful Expression"}, 
	{"Nethermancer", "Armored Matrix", "Bargain w/ Summoned Creature"}, 
	{"Shaman", "Summon", "Summoning Circle"},
	{"Scout", "Cat\'s Paw", "Wound Balance"}, 
	{"Sky Raider", "Defense", "Weapon Breaker"}, 
	{"Swordmaster", "Quickblade", "Shield Beater"}, 
	{"Thief", "Bank Shot", "Sprint"}, 
	{"Troubadour", "Impressive Shot", "Song of Deflection"}, 
	{"Warrior", "Elemental Tongues", "Vitality"}, 
	{"Weaponsmith", "Forge Armor", "Elementalism"}, 
	{"Wizard", "Armored Matrix", "Casting Pattern"},
	{"Woodsman", "Develop Animal Sense (BE)", "Impressive Shot (BE)"}
    };
    
    String[][] TwelveTals = {
	{"Air Sailor", "Resist Taunt", "Vitality"}, 
	{"Archer", "Create Arrow", "Shield Beater"}, 
	{"Beastmaster", "Bestial Resilience", "Chameleon"}, 
	{"Cavalryman", "Frighten Animal Servants", "Momentum Attack"}, 
	{"Elementalist", "Armored Matrix", "Bargain w/ Summoned Creature"}, 
	{"Illusionist", "Matrix Strike", "Resist Taunt"}, 
	{"Nethermancer", "Matrix Strike", "Netherwalk"}, 
	{"Scout", "Defense", "Quickblade"}, 
	{"Shaman", "Bargain w/ Summoned Creature", "Sense Poison"},
	{"Sky Raider", "Howl", "Vitality"}, 
	{"Swordmaster", "Defense", "Life Check"}, 
	{"Thief", "Quickblade", "Sense Poison"}, 
	{"Troubadour", "Thought Link", "Truth Skit"}, 
	{"Warrior", "Chameleon", "Unmount"}, 
	{"Weaponsmith", "Soften Blade", "Enhanced Matrix"}, 
	{"Wizard", "Armored Matrix", "Wound Transfer"},
	{"Woodsman", "Chameleon (BE)", "Woodwalk (BE)"}
    };
	
    String[][] ThirteenTals = {
	{"Air Sailor", "Matrix Strike", "Second Chance"}, 
	{"Archer", "Defense", "Screaming Arrow"}, 
	{"Beastmaster", "Pin", "Shield Beater"}, 
	{"Cavalryman", "Mystic Aim", "Shield Beater"}, 
	{"Elementalist", "Astral Sight", "Moving Earth"}, 
	{"Illusionist", "Astral Sight", "Shared Matrix"}, 
	{"Nethermancer", "Share Matrix", "Spell Crystal Lock"}, 
	{"Scout", "Momentum Attack", "Safe Path"}, 
	{"Shaman", "Armoured Fetish", "Plant Shelter"},
	{"Sky Raider", "Matrix Strike", "Screaming Arrow"}, 
	{"Swordmaster", "Champion Challenge", "Spirit Strike"}, 
	{"Thief", "Called Shot", "Chameleon"}, 
	{"Troubadour", "Blood Guilt Weapon", "Detect Influence"}, 
	{"Warrior", "Safe Path", "Stone Skin"}, 
	{"Weaponsmith", "Critical Hit", "Improve Armor"}, 
	{"Wizard", "Share Matrix", "True Sight"}
    };
    
    String[][] FourteenTals = {
	{"Air Sailor", "Quickblade", "Second Attack"}, 
	{"Archer", "Multi-Shot", "Second Attack"}, 
	{"Beastmaster", "Echo Location", "Spirit Strike"}, 
	{"Cavalryman", "Spot Armor Flaw", "Trample"}, 
	{"Elementalist", "Earth Armor", "Share Matrix"}, 
	{"Illusionist", "Multiweaving", "Share Matrix"}, 
	{"Nethermancer", "Ethereal Weapon", "Share Matrix"}, 
	{"Scout", "Matrix Strike", "Poison Resistance"}, 
	{"Shaman", "Detect Influence", "Armoured Fetish"},
	{"Sky Raider", "Quickblade", "Second Attack"}, 
	{"Swordmaster", "Multi-Strike", "Matrix Strike"}, 
	{"Thief", "Defense", "Fasthand"}, 
	{"Troubadour", "Life Check", "Spirit Talk"}, 
	{"Warrior", "Elemental Hold", "Vital Strike"}, 
	{"Weaponsmith", "Armored Matrix", "First Ring of Perfection"}, 
	{"Wizard", "Orbiting Spy", "Share Matrix"}
    };
    
    String[][] FifteenTals = {
	{"Air Sailor", "Life Check", "True Shot"}, 
	{"Archer", "Ethereal Weapon", "Wind Bow"}, 
	{"Beastmaster", "Venom", "Web Astral"}, 
	{"Cavalryman", "Multi-Charge", "Life Check"}, 
	{"Elementalist", "Hold Thread", "Share Matrix"}, 
	{"Illusionist", "Second Chance", "Share Matrix"}, 
	{"Nethermancer", "Share Matrix", "Soul Shatter"}, 
	{"Scout", "Echo Location", "Ethereal Weapon"}, 
	{"Shaman", "Netherwalk", "Matrix Strike"},
	{"Sky Raider", "Stone Skin", "True Shot"}, 
	{"Swordmaster", "Ethereal Weapon", "Vital Strike"}, 
	{"Thief", "Gain Surprise", "True Sight"}, 
	{"Troubadour", "Aura Armor", "Confront Horror"}, 
	{"Warrior", "Aura Armor", "Multi-Strike"}, 
	{"Weaponsmith", "Second Chance", "Share Matrix"}, 
	{"Wizard", "Effect Pattern", "Share Matrix"}
    };
    
    int[][] talCosts = {
	{1, 100, 200, 300, 500, 800, 1300, 2100, 3400, 5500, 8900, 14400, 23300, 37700, 61000, 98700}, 
	{5, 200, 300, 500, 800, 1300, 2100, 3400, 5500, 8900, 14400, 23300, 37700, 61000, 98700, 159700}, 
	{9, 300, 500, 800, 1300, 2100, 3400, 5500, 8900, 14400, 23300, 37700, 61000, 98700, 159700, 258400}, 
	{13, 500, 800, 1300, 2100, 3400, 5500, 8900, 14400, 23300, 37700, 61000, 98700, 159700, 258400, 418100}
    };
    
    
    Panel panel1, panel2, panel3, panel4, panel5, panel6;
    
    GridBagLayout gridbag = new GridBagLayout();
    
    public void init() {
	
	name = new TextField(20);
	name.setEditable(true);
	name.addActionListener(this);
	
	//	All of the Discipline Choices
	disc = new Choice();
	disc.addItem("Air Sailor");
	disc.addItem("Archer");
	disc.addItem("Beastmaster");
	disc.addItem("Boatman");
	disc.addItem("Cavalryman");
	disc.addItem("Elementalist");
	disc.addItem("Horror Stalker");
	disc.addItem("Hunter");
	disc.addItem("Illusionist");
	disc.addItem("Liberator");
	disc.addItem("Nethermancer");
	disc.addItem("Outcast Warrior");
	disc.addItem("Purifier");
	disc.addItem("Scout");
	disc.addItem("Shaman");
	disc.addItem("Sky Raider");
	disc.addItem("Swordmaster");
	disc.addItem("Thief");
	disc.addItem("Traveled Scholar");
	disc.addItem("Troubadour");
	disc.addItem("Warrior");
	disc.addItem("Weaponsmith");
	disc.addItem("Wind-Dancer");
	disc.addItem("Windmaster");
	disc.addItem("Windscout");
	disc.addItem("Wizard");
	disc.addItem("Woodsman");
	disc.select("Elementalist");
	disc.addItemListener(this);
	
	race = new Choice();
	race.addItem("Blood Elf");
	race.addItem("Dwarf");
	race.addItem("Elf");
	race.addItem("Human");
	race.addItem("Jackalman");
	race.addItem("Jubruq");
	race.addItem("Leafer");
	race.addItem("Obsidiman");
	race.addItem("Ork");
	race.addItem("Troll");
	race.addItem("T\'skrang");
	race.addItem("Ulk-man");
	race.addItem("Windling");
	race.select("Human");
	race.addItemListener(this);
	
	circ = new Choice();
	circ.addItem("1");
	circ.addItem("2");
	circ.addItem("3");
	circ.addItem("4");
	circ.addItem("5");
	circ.addItem("6");
	circ.addItem("7");
	circ.addItem("8");
	circ.addItem("9");
	circ.addItem("10");
	circ.addItem("11");
	circ.addItem("12");
	circ.addItem("13");
	circ.addItem("14");
	circ.addItem("15");
	circ.addItemListener(this);
	
	panel1 = new Panel();
	panel1.setLayout(gridbag);
	
	//	Sets up the first, and top, panel.
	constrain(panel1, new Label("Name"), 0, 0, 1, 1);
	constrain(panel1, name, 1, 0, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 10);
	constrain(panel1, new Label("Discipline"), 3, 0, 1, 1);
	constrain(panel1, disc, 4, 0, 1, 1);
	constrain(panel1, new Label("Race"), 5, 0, 1, 1);
	constrain(panel1, race, 6, 0, 1, 1);
	constrain(panel1, new Label("Circle"), 7, 0, 1, 1);
	constrain(panel1, circ, 8, 0, 1, 1);
	
	dex = new Choice();
	attributeset(2, 18, dex);
	dex.addItemListener(this);
	
	str = new Choice();
	attributeset(2, 18, str);
	str.addItemListener(this);
		
	tou = new Choice();
	attributeset(2, 18, tou);
	tou.addItemListener(this);
		
	per = new Choice();
	attributeset(2, 18, per);
	per.addItemListener(this);
	
	wil = new Choice();
	attributeset(2, 18, wil);
	wil.addItemListener(this);
		
	cha = new Choice();
	attributeset(2, 18, cha);
	cha.addItemListener(this);
		
	dexm = new TextField(3);
	dexm.setText(arraySearch(dex, attSteps));
	dexm.setEditable(false);
		
	strm = new TextField(3);
	strm.setText(arraySearch(str, attSteps));
	strm.setEditable(false);
	
	toum = new TextField(3);
	toum.setText(arraySearch(tou, attSteps));
	toum.setEditable(false);
		
	perm = new TextField(3);
	perm.setText(arraySearch(per, attSteps));
	perm.setEditable(false);
	
	wilm = new TextField(3);
	wilm.setText(arraySearch(wil, attSteps));
	wilm.setEditable(false);
		
	cham = new TextField(3);
	cham.setText(arraySearch(cha, attSteps));
	cham.setEditable(false);
		
	dexs = new TextField();
	dexs.setText(arraySearch(dex, attSteps));
	dexs.setEditable(false);
		
	strs = new TextField();
	strs.setText(arraySearch(str, attSteps));
	strs.setEditable(false);
		
	tous = new TextField();
	tous.setText(arraySearch(tou, attSteps));
	tous.setEditable(false);
		
	pers = new TextField();
	pers.setText(arraySearch(per, attSteps));
	pers.setEditable(false);
		
	wils = new TextField();
	wils.setText(arraySearch(wil, attSteps));
	wils.setEditable(false);
		
	chas = new TextField();
	chas.setText(arraySearch(cha, attSteps));
	chas.setEditable(false);
		
	panel2 = new Panel();
	panel2.setLayout(gridbag);
	
	//	Sets up the attribute section.
	constrain(panel2, new Label("Value"), 1, 0, 1, 1);
	constrain(panel2, new Label("Mod."), 2, 0, 1, 1);
	constrain(panel2, new Label("Step"), 3, 0, 1, 1);
	constrain(panel2, new Label("DEX"), 0, 1, 1, 1);
	constrain(panel2, dex, 1, 1, 1, 1);
	constrain(panel2, dexm, 2, 1, 1, 1);
	constrain(panel2, dexs, 3, 1, 1, 1);
	constrain(panel2, new Label("STR"), 0, 2, 1, 1);
	constrain(panel2, str, 1, 2, 1, 1);
	constrain(panel2, strm, 2, 2, 1, 1);
	constrain(panel2, strs, 3, 2, 1, 1);
	constrain(panel2, new Label("TOU"), 0, 3, 1, 1);
	constrain(panel2, tou, 1, 3, 1, 1);
	constrain(panel2, toum, 2, 3, 1, 1);
	constrain(panel2, tous, 3, 3, 1, 1);
	constrain(panel2, new Label("PER"), 0, 4, 1, 1);
	constrain(panel2, per, 1, 4, 1, 1);
	constrain(panel2, perm, 2, 4, 1, 1);
	constrain(panel2, pers, 3, 4, 1, 1);
	constrain(panel2, new Label("WIL"), 0, 5, 1, 1);
	constrain(panel2, wil, 1, 5, 1, 1);
	constrain(panel2, wilm, 2, 5, 1, 1);
	constrain(panel2, wils, 3, 5, 1, 1);
	constrain(panel2, new Label("CHA"), 0, 6, 1, 1);
	constrain(panel2, cha, 1, 6, 1, 1);
	constrain(panel2, cham, 2, 6, 1, 1);
	constrain(panel2, chas, 3, 6, 1, 1);
	
	attPts = new TextField("66", 3);
	attPts.setEditable(false);
	
	defph = new TextField(3);
	defph.setText(arraySearch(dex, defenses));
	defph.setEditable(false);
	
	defsp = new TextField(3);
	defsp.setText(arraySearch(per, defenses));
	defsp.setEditable(false);
	
	defso = new TextField(3);
	defso.setText(arraySearch(cha, defenses));
	defso.setEditable(false);
	
	armp = new TextField(3);
	//		armp.setText(arraySearch(dex, armors));
	armp.setEditable(false);
	
	armm = new TextField(3);
	armm.setText(arraySearch(wil, armors));
	armm.setEditable(false);
	
	movf = new TextField(3);
	movf.setText(arraySearch(dex, moveFull));
	movf.setEditable(false);
	
	movc = new TextField(3);
	movc.setText(arraySearch(dex, moveCom));
	movc.setEditable(false);
	
	strc = new TextField(4);
	strc.setText(arraySearch(str, strCarry));
	strc.setEditable(false);
	
	strl = new TextField(4);
	strl.setText(arraySearch(str, strLift));
	strl.setEditable(false);
	
	panel3 = new Panel();
	panel3.setLayout(gridbag);
	
	constrain(panel3, new Label("Purchase Points:"), 0, 0, 1, 1);
	constrain(panel3, attPts, 1, 0, 1, 1);
	
	constrain(panel3, new Label("Defense:"), 0, 1, 1, 1);
	constrain(panel3, new Label("Physical"), 0, 2, 1, 1);
	constrain(panel3, defph, 1, 2, 1, 1);
	constrain(panel3, new Label("Spell"), 0, 3, 1, 1);
	constrain(panel3, defsp, 1, 3, 1, 1);
	constrain(panel3, new Label("Social"), 0, 4, 1, 1);
	constrain(panel3, defso, 1, 4, 1, 1);
	
	constrain(panel3, new Label("Armor:"), 0, 5, 1, 1);
	constrain(panel3, new Label("Physical"), 0, 6, 1, 1);
	constrain(panel3, armp, 1, 6, 1, 1);
	constrain(panel3, new Label("Mystic"), 0, 7, 1, 1);
	constrain(panel3, armm, 1, 7, 1, 1);
	
	constrain(panel3, new Label("Movement:"), 0, 8, 1, 1);
	constrain(panel3, new Label("Full"), 0, 9, 1, 1);
	constrain(panel3, movf, 1, 9, 1, 1);
	constrain(panel3, new Label("Combat"), 0, 10, 1, 1);
	constrain(panel3, movc, 1, 10, 1, 1);
		
	constrain(panel3, new Label("Strength:"), 0, 11, 1, 1);
	constrain(panel3, new Label("Carry"), 0, 12, 1, 1);
	constrain(panel3, strc, 1, 12, 1, 1);
	constrain(panel3, new Label("Lift"), 0, 13, 1, 1);
	constrain(panel3, strl, 1, 13, 1, 1);
		
	talPts = new TextField("8", 3);
	talPts.setEditable(false);
	
	incr = new Button();
	incr.setLabel("Increase Rank");
	incr.addActionListener(this);
	
	decr = new Button();
	decr.setLabel("Decrease Rank");
	decr.addActionListener(this);
	
	inits = new TextField(3);
	inits.setText(arraySearch(dex, attSteps));
	inits.setEditable(false);
	
	//	Have to change this one later.
	initf = new TextField(3);
	initf.setText(arraySearch(dex, attSteps));
	initf.setEditable(false);
	
	dth = new TextField(3);
	dth.setText(arraySearch(tou, dthRat));
	dth.setEditable(false);
		
	unc = new TextField(3);
	unc.setText(arraySearch(tou, uncRat));
	unc.setEditable(false);
		
	wnd = new TextField(3);
	wnd.setText(arraySearch(tou, wndThr));
	wnd.setEditable(false);
		
	rec = new TextField(3);
	rec.setText(arraySearch(tou, recTsts));
	rec.setEditable(false);
		
	recd = new TextField(3);
	recd.setText(arraySearch(tou, recTsts));
	recd.setEditable(false);
	
	karc = new TextField(3);
	karc.setText(arraySearch(race, karStart));
	karc.setEditable(false);
	
	karm = new TextField(3);
	karm.setText(arraySearch(race, karMax));
	karm.setEditable(false);
	
	karcst = new TextField(3);
	karcst.setText(arraySearch(race, karCst));
	karcst.setEditable(false);
	
	kard = new TextField(3);
	kard.setText(arraySearch(race, karDie));
	kard.setEditable(false);
	
	karmod = new TextField(3);
	karmod.setText("0");
	karmod.setEditable(true);
	karmod.addActionListener(this);
	
	legt = new TextField(7);
	legt.setText("0");
	legt.setEditable(false);
	
	legc = new TextField(7);
	legc.setText("0");
	legc.setEditable(false);
	
	legs = new TextField(3);
	legs.setText("0");
	legs.setEditable(false);
		
	legm = new TextField(7);
	legm.setText("0");
	legm.setEditable(true);
	legm.addActionListener(this);
	
	panel4 = new Panel();
	panel4.setLayout(gridbag);
	
	constrain(panel4, new Label("Talent Ranks:"), 0, 0, 1, 1);
	constrain(panel4, talPts, 1, 0, 1, 1);
	constrain(panel4, incr, 0, 1, 2, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 10);
	constrain(panel4, decr, 0, 2, 2, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 10);
	constrain(panel4, new Label("Initiative:"), 0, 3, 1, 1);
	constrain(panel4, new Label("Dex. Step"), 0, 4, 1, 1);
	constrain(panel4, inits, 1, 4, 1, 1);
	constrain(panel4, new Label("Final Step"), 0, 5, 1, 1);
	constrain(panel4, initf, 1, 5, 1, 1);
	constrain(panel4, new Label("Damage:"), 0, 6, 1, 1);
	constrain(panel4, new Label("Death Rating"), 0, 7, 1, 1);
	constrain(panel4, dth, 1, 7, 1, 1);
	constrain(panel4, new Label("Uncon. Rating"), 0, 8, 1, 1);
	constrain(panel4, unc, 1, 8, 1, 1);
	constrain(panel4, new Label("Wound Threshold"), 0, 9, 1, 1);
	constrain(panel4, wnd, 1, 9, 1, 1);
	constrain(panel4, new Label("Recovery Tests"), 0, 10, 1, 1);
	constrain(panel4, rec, 1, 10, 1, 1);
	constrain(panel4, new Label("Recovery Die"), 0, 11, 1, 1);
	constrain(panel4, recd, 1, 11, 1, 1);
	constrain(panel4, new Label("Karma:"), 0, 12, 1, 1);
	constrain(panel4, new Label("Current"), 0, 13, 1, 1);
	constrain(panel4, karc, 1, 13, 1, 1);
	constrain(panel4, new Label("Maximum"), 0, 14, 1, 1);
	constrain(panel4, karm, 1, 14, 1, 1);
	constrain(panel4, new Label("Cost"), 0, 15, 1, 1);
	constrain(panel4, karcst, 1, 15, 1, 1);
	constrain(panel4, new Label("Karma Die"), 0, 16, 1, 1);
	constrain(panel4, kard, 1, 16, 1, 1);
	constrain(panel4, new Label("Add to Karma"), 0, 17, 1, 1);
	constrain(panel4, karmod, 1, 17, 1, 1);
	constrain(panel4, new Label("Legend:"), 0, 18, 1, 1);
	constrain(panel4, new Label("Total"), 0, 19, 1, 1);
	constrain(panel4, legt, 1, 19, 1, 1);
	constrain(panel4, new Label("Current"), 0, 20, 1, 1);
	constrain(panel4, legc, 1, 20, 1, 1);
	constrain(panel4, new Label("Leg. Status"), 0, 21, 1, 1);
	constrain(panel4, legs, 1, 21, 1, 1);
	constrain(panel4, new Label("Add to LP"), 0, 22, 1, 1);
	constrain(panel4, legm, 1, 22, 1, 1);
	
	tal1 = new List(8, false);
	talText(tal1, OneTals);
	tal1.addItemListener(this);
	
	tal2 = new List(3, false);
	talText(tal2, TwoTals);
	tal2.addItemListener(this);
	
	tal3 = new List(3, false);
	talText(tal3, ThreeTals);
	tal3.addItemListener(this);
	
	tal4 = new List(3, false);
	talText(tal4, FourTals);
	tal4.addItemListener(this);
	
	tal5 = new List(3, false);
	talText(tal5, FiveTals);
	tal5.addItemListener(this);
	
	tal6 = new List(3, false);
	talText(tal6, SixTals);
	tal6.addItemListener(this);
	
	tal7 = new List(3, false);
	talText(tal7, SevenTals);
	tal7.addItemListener(this);
	
	panel5 = new Panel();
	panel5.setLayout(gridbag);
	
	constrain(panel5, new Label("First Circle"), 0, 0, 2, 1);
	constrain(panel5, tal1, 0, 1, 2, 8, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel5, new Label("Second Circle"), 0, 9, 2, 1);
	constrain(panel5, tal2, 0, 10, 2, 3, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel5, new Label("Third Circle"), 0, 13, 2, 1);
	constrain(panel5, tal3, 0, 14, 2, 2, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 1.0, 0, 0, 0, 0);
	constrain(panel5, new Label("Fourth Circle"), 0, 16, 2, 1);
	constrain(panel5, tal4, 0, 17, 2, 2, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 1.0, 0, 0, 0, 0);
	constrain(panel5, new Label("Fifth Circle"), 0, 19, 2, 1);
	constrain(panel5, tal5, 0, 20, 2, 2, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 1.0, 0, 0, 0, 0);
	constrain(panel5, new Label("Sixth Circle"), 0, 22, 2, 1);
	constrain(panel5, tal6, 0, 23, 2, 2, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 1.0, 0, 0, 0, 0);
	constrain(panel5, new Label("Seventh Circle"), 0, 25, 2, 1);
	constrain(panel5, tal7, 0, 26, 2, 2, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 1.0, 0, 0, 0, 0);
	
	tal8 = new List(3, false);
	talText(tal8, EightTals);
	tal8.addItemListener(this);
	
	tal9 = new List(3, false);
	talText(tal9, NineTals);
	tal9.addItemListener(this);
	
	tal10 = new List(3, false);
	talText(tal10, TenTals);
	tal10.addItemListener(this);
		
	tal11 = new List(3, false);
	talText(tal11, ElevenTals);
	tal11.addItemListener(this);
	
	tal12 = new List(3, false);
	talText(tal12, TwelveTals);
	tal12.addItemListener(this);
	
	tal13 = new List(3, false);
	talText(tal13, ThirteenTals);
	tal13.addItemListener(this);
	
	tal14 = new List(3, false);
	talText(tal14, FourteenTals);
	tal14.addItemListener(this);
	
	tal15 = new List(3, false);
	talText(tal15, FifteenTals);
	tal15.addItemListener(this);
	
	panel6 = new Panel();
	panel6.setLayout(gridbag);
	
	constrain(panel6, new Label("Eighth Circle"), 0, 0, 1, 1);
	constrain(panel6, tal8, 0, 1, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel6, new Label("Ninth Circle"), 0, 2, 1, 1);
	constrain(panel6, tal9, 0, 3, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel6, new Label("Tenth Circle"), 0, 4, 1, 1);
	constrain(panel6, tal10, 0, 5, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel6, new Label("Eleventh Circle"), 0, 6, 1, 1);
	constrain(panel6, tal11, 0, 7, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel6, new Label("Twelfth Circle"), 0, 8, 1, 1);
	constrain(panel6, tal12, 0, 9, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel6, new Label("Thirteenth Circle"), 0, 10, 1, 1);
	constrain(panel6, tal13, 0, 11, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel6, new Label("Fourteenth Circle"), 0, 12, 1, 1);
	constrain(panel6, tal14, 0, 13, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(panel6, new Label("Fifteenth Circle"), 0, 14, 1, 1);
	constrain(panel6, tal15, 0, 15, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	
	this.setLayout(gridbag);
	this.setBackground(Color.white);
	
	constrain(this, panel1, 0, 0, 16, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 0.0, 0, 0, 0, 0);
	constrain(this, panel2, 0, 1, 2, 4, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 0.0, 0.0, 0, 0, 0, 0);
	constrain(this, panel3, 0, 5, 2, 3, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 0.0, 1.0, 0, 0, 0, 0);
	constrain(this, panel4, 2, 1, 2, 7, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 0.0, 1.0, 0, 0, 0, 0);
	constrain(this, panel5, 4, 1, 6, 7, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 1.0, 0, 10, 0, 10);
	constrain(this, panel6, 10, 1, 6, 7, GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTHWEST, 1.0, 1.0, 0, 0, 0, 0);
	
	repaint();
    }
	
    public void actionPerformed(ActionEvent evt) {
	
	if (evt.getSource() == incr) {
	    writeTal(tal1, 1);
	    writeTal(tal2, 1);
	    writeTal(tal3, 1);
	    writeTal(tal4, 1);
	    writeTal(tal5, 1);
	    writeTal(tal6, 1);
	    writeTal(tal7, 1);
	    writeTal(tal8, 1);
	    writeTal(tal9, 1);
	    writeTal(tal10, 1);
	    writeTal(tal11, 1);
	    writeTal(tal12, 1);
	    writeTal(tal13, 1);
	    writeTal(tal14, 1);
	    writeTal(tal15, 1);
	}
	
	else if (evt.getSource() == decr) {
	    writeTal(tal1, -1);
	    writeTal(tal2, -1);
	    writeTal(tal3, -1);
	    writeTal(tal4, -1);
	    writeTal(tal5, -1);
	    writeTal(tal6, -1);
	    writeTal(tal7, -1);
	    writeTal(tal8, -1);
	    writeTal(tal9, -1);
	    writeTal(tal10, -1);
	    writeTal(tal11, -1);
	    writeTal(tal12, -1);
				writeTal(tal13, -1);
				writeTal(tal14, -1);
				writeTal(tal15, -1);		
	}
	
	else if (evt.getSource() == legm) {
	    try {
		int legmod = (Integer.valueOf(legm.getText()).intValue());
		legc.setText(String.valueOf(Integer.valueOf(legc.getText()).intValue() + legmod));
		legt.setText(String.valueOf(Integer.valueOf(legt.getText()).intValue() + legmod));
		legm.setText("0");
	    }  catch (NumberFormatException e) {
		legm.setText("0");
	    }
	}
	
	else if (evt.getSource() == karmod) {
	    try {
		int karmmod = (Integer.valueOf(karmod.getText()).intValue());
		if (Integer.valueOf(karc.getText()).intValue() + karmmod > Integer.valueOf(karm.getText()).intValue()) {
		    throw new NumberFormatException();
		}
		karc.setText(String.valueOf(Integer.valueOf(karc.getText()).intValue() + karmmod));
		legc.setText(String.valueOf((Integer.valueOf(legc.getText())).intValue() - karmmod * (Integer.valueOf(karcst.getText())).intValue()));
		karmod.setText("0");
	    }  catch (NumberFormatException e) {
		karmod.setText("0");
	    }
	}
	
    }
    
    
	
    public void itemStateChanged(ItemEvent evt)	{
	
	if (evt.getSource() == disc) {
	    modifyAllA();
	}
	
	else if (evt.getSource() == dex) {
	    modifyAll();
	}
	
	else if (evt.getSource() == str) {
	    modifyAll();
	}
			
	else if (evt.getSource() == tou) {
	    modifyAll();
	}
	
	else if (evt.getSource() == per) {
	    modifyAll();
	}
			
	else if (evt.getSource() == wil) {
	    modifyAll();
	}
			
	else if (evt.getSource() == cha) {
	    modifyAll();
	}
			
	else if (evt.getSource() == race) {
	    modifyAllA();
	}
			
	else	{
	    List list = (List)evt.getSource();
	    List[] tals = {tal1, tal2, tal3, tal4, tal5, tal6, tal7, tal8, tal9, tal10,
			   tal11, tal12, tal13, tal14, tal15};
	    for (int i = 0; i < 15; i++)	{
		if (tals[i] == list)	{}
		else
		    deselectTal(tals[i]);
	    }
	}
    }
    
    public void update(Graphics g) {
	paint(g);
    }
    
    // called if change in stat
    public void modifyAll() {
	int raceIndex = race.getSelectedIndex();
	attributeMod(attMods[raceIndex][0], dex, dexm);
	attributeMod(attMods[raceIndex][1], str, strm);
	attributeMod(attMods[raceIndex][2], tou, toum);
	attributeMod(attMods[raceIndex][3], per, perm);
	attributeMod(attMods[raceIndex][4], wil, wilm);
	attributeMod(attMods[raceIndex][5], cha, cham);
	dexs.setText(arraySearch(dexm.getText(), attSteps));
	strs.setText(arraySearch(strm.getText(), attSteps));
	tous.setText(arraySearch(toum.getText(), attSteps));
	pers.setText(arraySearch(perm.getText(), attSteps));
	wils.setText(arraySearch(wilm.getText(), attSteps));
	chas.setText(arraySearch(cham.getText(), attSteps));
	defph.setText(arraySearch(dexm.getText(), defenses));
	defsp.setText(arraySearch(perm.getText(), defenses));
	defso.setText(arraySearch(cham.getText(), defenses));
	//		armp.setText(arraySearch(dexm.getText(), armors));
	armm.setText(arraySearch(wilm.getText(), armors));
	movf.setText(arraySearch(String.valueOf((Integer.valueOf(dexm.getText())).intValue() + attMods[raceIndex][6]), moveFull));
	movc.setText(arraySearch(String.valueOf((Integer.valueOf(dexm.getText())).intValue() + attMods[raceIndex][6]), moveCom));
	strc.setText(arraySearch(strm.getText(), strCarry));
	strl.setText(arraySearch(strm.getText(), strLift));
	attPts.setText(String.valueOf(66 + 
				      (Integer.valueOf(arraySearch(dex, attCst))).intValue() + 
				      (Integer.valueOf(arraySearch(str, attCst))).intValue() + 
				      (Integer.valueOf(arraySearch(tou, attCst))).intValue() + 
				      (Integer.valueOf(arraySearch(per, attCst))).intValue() + 
				      (Integer.valueOf(arraySearch(wil, attCst))).intValue() +
				      (Integer.valueOf(arraySearch(cha, attCst))).intValue()));
	inits.setText(arraySearch(dexm.getText(), attSteps));
	initf.setText(arraySearch(dexm.getText(), attSteps));
	dth.setText(arraySearch(toum.getText(), dthRat));
	unc.setText(arraySearch(toum.getText(), uncRat));
	wnd.setText(arraySearch(toum.getText(), wndThr));
	rec.setText(arraySearch(toum.getText(), recTsts));
	recd.setText(arraySearch(toum.getText(), recTsts));
	
    }
    
    //called if change in race or discipline
    public void modifyAllA() {
	int raceIndex = race.getSelectedIndex();
	attributeMod(attMods[raceIndex][0], dex, dexm);
	attributeMod(attMods[raceIndex][1], str, strm);
	attributeMod(attMods[raceIndex][2], tou, toum);
	attributeMod(attMods[raceIndex][3], per, perm);
	attributeMod(attMods[raceIndex][4], wil, wilm);
	attributeMod(attMods[raceIndex][5], cha, cham);
	dexs.setText(arraySearch(dexm.getText(), attSteps));
	strs.setText(arraySearch(strm.getText(), attSteps));
	tous.setText(arraySearch(toum.getText(), attSteps));
	pers.setText(arraySearch(perm.getText(), attSteps));
	wils.setText(arraySearch(wilm.getText(), attSteps));
	chas.setText(arraySearch(cham.getText(), attSteps));
	defph.setText(arraySearch(dexm.getText(), defenses));
	defsp.setText(arraySearch(perm.getText(), defenses));
	defso.setText(arraySearch(cham.getText(), defenses));
	//		armp.setText(arraySearch(dexm.getText(), armors));
	armm.setText(arraySearch(wilm.getText(), armors));
	movf.setText(arraySearch(String.valueOf((Integer.valueOf(dexm.getText())).intValue() + attMods[raceIndex][6]), moveFull));
	movc.setText(arraySearch(String.valueOf((Integer.valueOf(dexm.getText())).intValue() + attMods[raceIndex][6]), moveCom));
	strc.setText(arraySearch(strm.getText(), strCarry));
	strl.setText(arraySearch(strm.getText(), strLift));
	inits.setText(arraySearch(dexm.getText(), attSteps));
	initf.setText(arraySearch(dexm.getText(), attSteps));
	dth.setText(arraySearch(toum.getText(), dthRat));
	unc.setText(arraySearch(toum.getText(), uncRat));
	wnd.setText(arraySearch(toum.getText(), wndThr));
	rec.setText(arraySearch(toum.getText(), recTsts));
	recd.setText(arraySearch(toum.getText(), recTsts));
	karc.setText(arraySearch(race, karStart));
	karm.setText(arraySearch(race, karMax));
	karcst.setText(arraySearch(race, karCst));
	kard.setText(arraySearch(race, karDie));
	talPts.setText("8");
	talText(tal1, OneTals);
	talText(tal2, TwoTals);
	talText(tal3, ThreeTals);
	talText(tal4, FourTals);
	talText(tal5, FiveTals);
	talText(tal6, SixTals);
	talText(tal7, SevenTals);
	talText(tal8, EightTals);
	talText(tal9, NineTals);
	talText(tal10, TenTals);
	talText(tal11, ElevenTals);
	talText(tal12, TwelveTals);
	talText(tal13, ThirteenTals);
	talText(tal14, FourteenTals);
	talText(tal15, FifteenTals);
	legc.setText("0");
	legt.setText("0");
	legs.setText("0");
	
    }
    //	The String array passed to this method must be in the form
    //	of x arrays, each of 2 length.  Main arraySearch method.
    public String arraySearch(String value, String[][] attArray) {
	
	int i;
	
	for ( i = 0; i < attArray.length; i++ ) {
	    if (attArray[i][0].equals(value)) {
		return attArray[i][1];
	    }
	}
	return "--";
    }
    
    //	This arraySearch method is used to find the value of a Choice
    //	and send it to the main arraySearch method.
    public String arraySearch(Choice choice, String[][] attArray) {
	
	String value = choice.getSelectedItem();
	
	return arraySearch(value, attArray);
    }
    
    public void writeTal(List list, int mod) {
	
	try {
	    String talent = list.getSelectedItem();
	    int position = list.getSelectedIndex();
	    int rank = (Integer.valueOf(getTRank(talent))).intValue();
	    int points = (Integer.valueOf(talPts.getText())).intValue();
	    int newpoints = points - mod;
	    int newrank = rank + mod;
	    if (newrank < 0) {
		throw new NullPointerException();
	    }
	    String strnew = String.valueOf(newrank);
	    if (strnew.length() == 1) {
		strnew = strnew + " ";
	    }
	    talent = strnew + talent.substring(2, talent.length());
	    list.replaceItem(talent, position);
	    list.select(position);
	    if (list != tal1 | points == 0)	{
		int i = 0;
		if (list == tal1 | list == tal2 | list == tal3 | list == tal4) {
		    i = 0;
		} else if (list == tal5 | list == tal6 | list == tal7 | list == tal8) {
		    i = 1;
		} else if (list == tal9 | list == tal10 | list == tal11 | list == tal12) {
		    i = 2;
		} else if (list == tal13 | list == tal14 | list == tal15) {
		    i = 3;
		}
		if (newrank > rank) {
		    legc.setText(String.valueOf((Integer.valueOf(legc.getText())).intValue() - talCosts[i][newrank]));
		} else if (newrank < rank) {
		    legc.setText(String.valueOf((Integer.valueOf(legc.getText())).intValue() + talCosts[i][rank]));
		}
	    }
	    else	{
		if (newrank > rank) {
		    talPts.setText(String.valueOf((Integer.valueOf(talPts.getText())).intValue() - 1));
		} else if (newrank < rank) {
		    talPts.setText(String.valueOf((Integer.valueOf(talPts.getText())).intValue() + 1));
		}
	    }
	    
	} catch (NullPointerException e) {
	}
    }
    
    
    public void deselectTal(List list)	{
	int i = list.getSelectedIndex();
	list.deselect(i);
    }
    
    public String getTRank(String string) {
	String rank;
	if (string.substring(1, 2).equals(" ")) {
	    rank = string.substring(0, 1);
	} else {
	    rank = string.substring(0, 2);
	}
	return rank;
    }
    
    public void talText(List field, String[][] tallist) {
	
	String discname = disc.getSelectedItem();
	
	field.removeAll();
	
	for (int i = 0; i < tallist.length; i++) {
	    if (tallist[i][0].equals(discname)) {
		for (int j = 1; j < tallist[i].length; j++) {
		    field.addItem("0  " + tallist[i][j]);
		}
	    }
	}
    }
    
    
    //	Sets a list of Attribute Choices to a specified range.
    public void attributeset(int min, int max, Choice choice) {
	
	int i;
	
	for ( i = min; i <= max; i++) {
	    String add = String.valueOf(i);;
	    choice.addItem(add);
	    choice.select("5");
	}
    }
    
    public void attributeMod(int mod, Choice choice, TextField field) {
	
	int attribute = (Integer.valueOf(choice.getSelectedItem())).intValue();
	
	int modatt = attribute + mod;
	
	field.setText(String.valueOf(modatt));
	
    }
    
    //	This is the main constrain() method.
    //	It has arguments for all constraints.
    public void constrain(Container container, Component component,
			  int grid_x, int grid_y, int grid_width, int grid_height,
			  int fill, int anchor, double weight_x, double weight_y,
			  int top, int left, int bottom, int right)
    {
	GridBagConstraints c = new GridBagConstraints();
	c.gridx = grid_x;
	c.gridy = grid_y;
	c.gridwidth = grid_width;
	c.gridheight = grid_height;
	c.fill = fill;
	c.anchor = anchor;
	c.weightx = weight_x;
	c.weighty = weight_y;
	if (top + bottom + left + right > 0)
	    c.insets = new Insets(top, left, bottom, right);
	
	((GridBagLayout)container.getLayout()).setConstraints(component, c);
	container.add(component);
    }
    
    //	This version of constrain() specifies the position of a component
    //	that does not grow and does not have margins.
    public void constrain(Container container, Component component,
			  int grid_x, int grid_y, int grid_width, int grid_height) {
	constrain(container, component, grid_x, grid_y, grid_width,
		  grid_height, GridBagConstraints.NONE,
		  GridBagConstraints.NORTHWEST, 0.0, 0.0, 0, 0, 0, 0);
    }
    
    //	This version of constrain() opisitions a component that does
    //	not grow, but does have margins.
    public void constrain(Container container, Component component,
			  int grid_x, int grid_y, int grid_width, int grid_height,
			  int top, int left, int bottom, int right) {
	constrain(container, component, grid_x, grid_y, grid_width,
		  grid_height, GridBagConstraints.NONE,
		  GridBagConstraints.NORTHWEST, 0.0, 0.0, top, left, bottom, right);
    }
}
