I have a class KeyCards.java that just sets up a panel (gui) with labels,combobox and text fields

when the combobox is selected a class generates strings to send to a class
public Class Progressions extends KeyCards and puts the strings in setters.
once all the strings are there it calls a method showKey() to set all the text fields in KeyCards.java

showKey() prints out that is has the right string but nothing goes in the text fields

should showKey() set the text fields a different way?

public void showKey() {

        System.out.println("showKey sets all textfields");
        sigTxt.setText(strSigTxt);
        System.out.println("showKey(): "+strSigTxt);
        relaToneTxt.setText(strRelaToneTxt);
        paraToneTxt.setText(strParaToneTxt);
        relaSigTxt.setText(strRelaSigTxt);
        paraSigTxt.setText(strParaSigTxt);
        majTxt.setText(strMajTxt);
        iTxt.setText(strITxt);
        ivTxt.setText(strIVTxt);
        viiDDtxt.setText(strVIIDDTxt);
        iiiTxt.setText(strIIITxt);
        viTxt.setText(strVITxt);
        iiTxt.setText(strIITxt);
        vTxt.setText(strVTxt);

        //textfield relamin
        relaMinTxt.setText(strRelaMinTxt);
        iRelaTxt.setText(strIRelaTxt);
        ivRelaTxt.setText(strIVRelaTxt);
        viiDDRelaTxt.setText(strVIIDDRelaTxt);
        iiiAugRelaTxt.setText(strIIIAugRelaTxt);
        viRelaTxt.setText(strVIRelaTxt);
        iiDDRelaTxt.setText(strIIDDRelaTxt);
        vRelaTxt.setText(strVRelaTxt);
        //texfield paramin

        paraMinTxt.setText(strParaMinTxt);
        iParaTxt.setText(strIParaTxt);
        ivParaTxt.setText(strIVParaTxt);
        viiDDParaTxt.setText(strVIIDDParaTxt);
        iiiAugParaTxt.setText(strIIIAugParaTxt);
        viParaTxt.setText(strVIParaTxt);
        iiDDParaTxt.setText(strIIDDParaTxt);
        vParaTxt.setText(strVParaTxt);

        //appegio==========================
        // amajTxt.setText(");
        aITxt.setText(strAITxt);
        aIVTxt.setText(strAIVTxt);
        aVIIDDTxt.setText(strAVIIDDTxt);
        aIIITxt.setText(strAIIITxt);
        aVITxt.setText(strAVITxt);
        aIITxt.setText(strAIITxt);
        aVTxt.setText(strAVTxt);

        //arelaMinTxt.setText(");
        rAITxt.setText(strRAITxt);
        rAIVTxt.setText(strRAIVTxt);
        rAVIIDDTxt.setText(strRAVIIDDTxt);
        rAIIIAugTxt.setText(strRAIIIAugTxt);
        rAVITxt.setText(strRAVITxt);
        rAIIDDTxt.setText(strRAIIDDTxt);
        rAVTxt.setText(strRAVTxt);
        //Car. aparamin);

        pAITxt.setText(strPAITxt);
        pAIVTxt.setText(strPAIVTxt);
        pAVIIDDTxt.setText(strPAVIIDDTxt);
        pAIIIAugTxt.setText(strPAIIIAugTxt);
        pAVITxt.setText(strPAVITxt);
        pAIIDDTxt.setText(strPAIIDDTxt);
        pAVTxt.setText(strPAVTxt);

    }

Are those JTextFields? If so, setText is the right method.
http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html

Are you sure your text fields are properly initialized and added to the panel? Can you post a bit more code showing where this is done? And have you taken similar steps in your code as I have in this example:

package kyle;

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

public class TextFieldTest {

	static JTextField field = new JTextField("text here!!");
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		JFrame frame = new JFrame("Text Field Test");
		JPanel panel = new JPanel();
		panel.add(field);
		frame.add(panel);
		frame.setVisible(true);
		frame.setSize(250,250);
		
		try {
			Thread.currentThread().sleep(3000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		field.setText("different text now.");
	}

}

(Ignore bad usage of Thread.sleep, etc, that was just a quick example - I'm referring to whether or not you added your panel to your frame, otherwise your text fields won't show to begin with. Can you see your text fields to begin with?)

Comments
Incredible! BestJewSinceJC showed me some very impotant programming concepts.

Yes here is updated code. this showKey() is in the KeyCards.java
and I added the x=new JTextField() and it eliminated some nullpointer exceptions but I do not know if it is right.

I Checked the keyCards.java (the GUI) and all the JTextField,labels and Comboboxs are all good.

The getters and setters all set correcty in a

public class Progression extends KeyCArds

Progression.java makes a call to the showKey() in KeyCards.java when all the JTextFields are all populated correctly.

showKey() System.out.println all the correct values. It just won't put the
text on the keyCard.java maybe because KeyCards.java was created first and it can't be accessed. I dont't know

public void showKey() {

        System.out.println("showKey sets all textfields");
        sigTxt = new JTextField();
        sigTxt.setText(strSigTxt);
        relaToneTxt = new JTextField();
        relaToneTxt.setText(strRelaToneTxt);
        paraToneTxt = new JTextField();
        paraToneTxt.setText(strParaToneTxt);
        relaSigTxt = new JTextField();
        relaSigTxt.setText(strRelaSigTxt);
        paraSigTxt = new JTextField();
        paraSigTxt.setText(strParaSigTxt);
        majTxt = new JTextField();
        majTxt.setText(strMajTxt);
        iTxt = new JTextField();
        iTxt.setText(strITxt);
        ivTxt = new JTextField();
        ivTxt.setText(strIVTxt);
        viiDDTxt = new JTextField();
        viiDDTxt.setText(strVIIDDTxt);
        iiiTxt = new JTextField();
        iiiTxt.setText(strIIITxt);
        viTxt = new JTextField();
        viTxt.setText(strVITxt);
        iiTxt = new JTextField();
        iiTxt.setText(strIITxt);
        vTxt = new JTextField();
        vTxt.setText(strVTxt);

        //textfield relamin
        relaMinTxt = new JTextField();
        relaMinTxt.setText(strRelaMinTxt);
        iRelaTxt = new JTextField();
        iRelaTxt.setText(strIRelaTxt);
        ivRelaTxt = new JTextField();
        ivRelaTxt.setText(strIVRelaTxt);
        viiDDRelaTxt = new JTextField();
        viiDDRelaTxt.setText(strVIIDDRelaTxt);
        iiiAugRelaTxt = new JTextField();
        iiiAugRelaTxt.setText(strIIIAugRelaTxt);
        viRelaTxt = new JTextField();
        viRelaTxt.setText(strVIRelaTxt);
        iiDDRelaTxt = new JTextField();
        iiDDRelaTxt.setText(strIIDDRelaTxt);
        vRelaTxt = new JTextField();
        vRelaTxt.setText(strVRelaTxt);
        //texfield paramin
        paraMinTxt = new JTextField();
        paraMinTxt.setText(strParaMinTxt);
        iParaTxt = new JTextField();
        iParaTxt.setText(strIParaTxt);
        ivParaTxt = new JTextField();
        ivParaTxt.setText(strIVParaTxt);
        viiDDParaTxt = new JTextField();
        viiDDParaTxt.setText(strVIIDDParaTxt);
        iiiAugParaTxt = new JTextField();
        iiiAugParaTxt.setText(strIIIAugParaTxt);
        viParaTxt = new JTextField();
        viParaTxt.setText(strVIParaTxt);
        iiDDParaTxt = new JTextField();
        iiDDParaTxt.setText(strIIDDParaTxt);
        vParaTxt = new JTextField();
        vParaTxt.setText(strVParaTxt);

        //appegio==========================
        // amajTxt.setText(");
        aITxt = new JTextField();
        aITxt.setText(strAITxt);
        aIVTxt = new JTextField();
        aIVTxt.setText(strAIVTxt);
        aVIIDDTxt = new JTextField();
        aVIIDDTxt.setText(strAVIIDDTxt);
        aIIITxt = new JTextField();
        aIIITxt.setText(strAIIITxt);
        aVITxt = new JTextField();
        aVITxt.setText(strAVITxt);
        aIITxt = new JTextField();
        aIITxt.setText(strAIITxt);
        aVTxt = new JTextField();
        aVTxt.setText(strAVTxt);

        //arelaMinTxt.setText(");
        rAITxt = new JTextField();
        rAITxt.setText(strRAITxt);
        rAIVTxt = new JTextField();
        rAIVTxt.setText(strRAIVTxt);
        rAVIIDDTxt = new JTextField();
        rAVIIDDTxt.setText(strRAVIIDDTxt);
        rAIIIAugTxt = new JTextField();
        rAIIIAugTxt.setText(strRAIIIAugTxt);
        rAVITxt = new JTextField();
        rAVITxt.setText(strRAVITxt);
        rAIIDDTxt = new JTextField();
        rAIIDDTxt.setText(strRAIIDDTxt);
        rAVTxt = new JTextField();
        rAVTxt.setText(strRAVTxt);
        //Car. aparamin);
        pAITxt = new JTextField();
        pAITxt.setText(strPAITxt);
        pAIVTxt = new JTextField();
        pAIVTxt.setText(strPAIVTxt);
        pAVIIDDTxt = new JTextField();
        pAVIIDDTxt.setText(strPAVIIDDTxt);
        pAIIIAugTxt = new JTextField();
        pAIIIAugTxt.setText(strPAIIIAugTxt);
        pAVITxt = new JTextField();
        pAVITxt.setText(strPAVITxt);
        pAIIDDTxt = new JTextField();
        pAIIDDTxt.setText(strPAIIDDTxt);
        pAVTxt = new JTextField();
        pAVTxt.setText(strPAVTxt);

    }

Here is the keyCards.java it is extremly long and the names of everything are related to several confusing descriptions of different musical terms
sorry but some represent 6 word descriptions
like pAVIIDDTxt = a text field for "parallel key Vii chord fully diminished Text"

any way Thanks for your time.

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package keycardsxml;

/*
 * KeyFrame4.java
 *
 * Created on June 26, 2006, 7:35 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
/*Key Cards created by James Stephen Howerton
//honor of ceyezumma
//Saturday, June 12, 2004
//data check:()
 */
import java.awt.*;
import java.io.IOException;
import java.lang.Object.*;
import java.awt.event.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.BorderFactory.*;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;

public class KeyCards extends JPanel implements ItemListener {
//__________________________________________constants

    public Font type;
    public int key = 0;
    public int sel = 0;
    //___________________________________________combobox
    public JComboBox majComboBox;
    public String[] majbox;
    //______________________________________________panels
    public JPanel card;
    public JPanel controlpan1;
    public JPanel keychoicepan;
    public JFrame f;
    public JPanel majpan1;
    public JPanel relapan1;
    public JPanel parapan1;
    public JPanel controlsig;
    public JPanel controlrelatone;
    public JPanel controlparatone;
    public JPanel controlrelasig;
    public JPanel controlparasig;
    public JPanel relasqueeze;
    public JPanel parasqueeze;
    public JPanel majTxtlblgrpI;
    public JPanel majTxtlblgrpIV;
    public JPanel majTxtlblgrpviidd;
    public JPanel majTxtlblgrpiii;
    public JPanel majTxtlblgrpvi;
    public JPanel majTxtlblgrpii;
    public JPanel majTxtlblgrpV;
    //============relamin grouping====
    public JPanel relatxtlblgrpi;
    public JPanel relatxtlblgrpiv;
    public JPanel relatxtlblgrpviiDD;
    public JPanel relatxtlblgrpIIIaug;
    public JPanel relatxtlblgrpVI;
    public JPanel relatxtlblgrpiidd;
    public JPanel relatxtlblgrpV;
    //=============paramin grouping===
    public JPanel paratxtlblgrpi;
    public JPanel paratxtlblgrpiv;
    public JPanel paratxtlblgrpviiDD;
    public JPanel paratxtlblgrpIIIaug;
    public JPanel paratxtlblgrpVI;
    public JPanel paratxtlblgrpiidd;
    public JPanel paratxtlblgrpV;
    //____________________________________________JLabels
    //============control JPanel====
    public JLabel siglbl;
    public JLabel relatonelbl;
    public JLabel paratonelbl;
    public JLabel relasiglbl;
    public JLabel parasiglbl;
    public JLabel reladummy1;
    public JLabel reladummy2;
    public JLabel paradummy1;
    public JLabel paradummy2;
    //=============================
    //maj
    //public JLabel majlbl;
    public JLabel iLbl;
    public JLabel ivLbl;
    public JLabel viiDDLbl;
    public JLabel iiiLbl;
    public JLabel viLbl;
    public JLabel iiLbl;
    public JLabel vLbl;
    //relamin
    //public JLabel relaminlbl;
    public JLabel iRelaLbl;
    public JLabel ivRelaLbl;
    public JLabel viiDDRelaLbl;
    public JLabel iiiAugRelaLbl;
    public JLabel viRelaLbl;
    public JLabel iiDDRelaLbl;
    public JLabel vRelaLbl;
    //paramin
    //public JLabel paraminlbl;
    public JLabel iParaLbl;
    public JLabel ivParaLbl;
    public JLabel viiDDParaLbl;
    public JLabel iiiAugParaLbl;
    public JLabel viParaLbl;
    public JLabel iiDDParaLbl;
    public JLabel vParaLbl;
    //appregio====================
    //public JLabel majlbl;
	/*public JLabel aiLbl;
    public JLabel aivLbl;
    public JLabel aviiDDLbl;
    public JLabel aiiiLbl;
    public JLabel aviLbl;
    public JLabel aiiLbl;
    public JLabel avLbl;
    //public JLabel relamin;
    public JLabel raiLbl;
    public JLabel raivLbl;
    public JLabel raviiDDLbl;
    public JLabel raIIIauglbl;
    public JLabel raViLbl;
    public JLabel raiiddlbl;
    public JLabel ravLbl;
    //public JLabel paramin;
    public JLabel paiLbl;
    public JLabel paivLbl;
    public JLabel paviiDDLbl;
    public JLabel paIIIauglbl;
    public JLabel paViLbl;
    public JLabel paiiddlbl;
    public JLabel pavLbl;*/
    //textield majTxt
    //=========control JPanel======
    //public JTextField keytxt;
    //__________________________________________JTextfields
    public JTextField sigTxt;
    public JTextField relaToneTxt;
    public JTextField paraToneTxt;
    public JTextField relaSigTxt;
    public JTextField paraSigTxt;
    //JTextField maj
    public JTextField majTxt;
    public JTextField iTxt;
    public JTextField ivTxt;
    public JTextField viiDDTxt;
    public JTextField iiiTxt;
    public JTextField viTxt;
    public JTextField iiTxt;
    public JTextField vTxt;
    //JTextField relamin
    public JTextField relaMinTxt;
    public JTextField iRelaTxt;
    public JTextField ivRelaTxt;
    public JTextField viiDDRelaTxt;
    public JTextField iiiAugRelaTxt;
    public JTextField viRelaTxt;
    public JTextField iiDDRelaTxt;
    public JTextField vRelaTxt;
    //JTextField paramin
    public JTextField paraMinTxt;
    public JTextField iParaTxt;
    public JTextField ivParaTxt;
    public JTextField viiDDParaTxt;
    public JTextField iiiAugParaTxt;
    public JTextField viParaTxt;
    public JTextField iiDDParaTxt;
    public JTextField vParaTxt;
    //appregio=========================
    //public JTextField amajTxt;
    public JTextField aITxt;
    public JTextField aIVTxt;
    public JTextField aVIIDDTxt;
    public JTextField aIIITxt;
    public JTextField aVITxt;
    public JTextField aIITxt;
    public JTextField aVTxt;
    //public JTextField arelaMinTxt;
    public JTextField rAITxt;
    public JTextField rAIVTxt;
    public JTextField rAVIIDDTxt;
    public JTextField rAIIIAugTxt;
    public JTextField rAVITxt;
    public JTextField rAIIDDTxt;
    public JTextField rAVTxt;
    //public JTextField aparamin;
    public JTextField pAITxt;
    public JTextField pAIVTxt;
    public JTextField pAVIIDDTxt;
    public JTextField pAIIIAugTxt;
    public JTextField pAVITxt;
    public JTextField pAIIDDTxt;
    public JTextField pAVTxt;
    //____________________________________________textField Strings
    public String strSigTxt;
    public String strRelaToneTxt;
    public String strParaToneTxt;
    public String strRelaSigTxt;
    public String strParaSigTxt;
    //String strmaj
    public String strMajTxt;
    public String strITxt;
    public String strIVTxt;
    public String strVIIDDTxt;
    public String strIIITxt;
    public String strVITxt;
    public String strIITxt;
    public String strVTxt;
    //String strrelamin
    public String strRelaMinTxt;
    public String strIRelaTxt;
    public String strIVRelaTxt;
    public String strVIIDDRelaTxt;
    public String strIIIAugRelaTxt;
    public String strVIRelaTxt;
    public String strIIDDRelaTxt;
    public String strVRelaTxt;
    //String strparamin
    public String strParaMinTxt;
    public String strIParaTxt;
    public String strIVParaTxt;
    public String strVIIDDParaTxt;
    public String strIIIAugParaTxt;
    public String strVIParaTxt;
    public String strIIDDParaTxt;
    public String strVParaTxt;
    //appregio=========================
    //public String stramajTxt;
    public String strAITxt;
    public String strAIVTxt;
    public String strAVIIDDTxt;
    public String strAIIITxt;
    public String strAVITxt;
    public String strAIITxt;
    public String strAVTxt;
    //public String strarelaMinTxt;
    public String strRAITxt;
    public String strRAIVTxt;
    public String strRAVIIDDTxt;
    public String strRAIIIAugTxt;
    public String strRAVITxt;
    public String strRAIIDDTxt;
    public String strRAVTxt;
    //public String straparamin;
    public String strPAITxt;
    public String strPAIVTxt;
    public String strPAVIIDDTxt;
    public String strPAIIIAugTxt;
    public String strPAVITxt;
    public String strPAIIDDTxt;
    public String strPAVTxt;
    public String strStore1;
    public String file;
    public String attribute;

    public KeyCards() {
    }

    public void theXMLDOC(String file) {
        this.file = file;
    }

    public void keyCardGUI() {
        setLayout(new FlowLayout());

        type = new Font(("Courier"), Font.BOLD, 12);
        f = new JFrame();
        ////////////////////////////////////////////
        ///////// start panels DO NOT CHANGE ///////
        ///////////////////////////////////////////
        //____________________________________________________panels
        card = new JPanel();
        card.setBorder(BorderFactory.createLoweredBevelBorder());
        controlpan1 = new JPanel();
        controlpan1.setBorder(BorderFactory.createLoweredBevelBorder());
        keychoicepan = new JPanel();
        keychoicepan.setBorder(BorderFactory.createLoweredBevelBorder());
        //+++++++overall JPanels+++++++++++++
        majpan1 = new JPanel();

        relapan1 = new JPanel();

        parapan1 = new JPanel();

        //controlpan1= new JPanel();
        controlsig = new JPanel();

        controlrelatone = new JPanel();

        controlparatone = new JPanel();

        controlrelasig = new JPanel();

        controlparasig = new JPanel();

        relasqueeze = new JPanel();
        parasqueeze = new JPanel();
        //=========major grouping========
        majTxtlblgrpI = new JPanel();

        majTxtlblgrpIV = new JPanel();

        majTxtlblgrpviidd = new JPanel();

        majTxtlblgrpiii = new JPanel();

        majTxtlblgrpvi = new JPanel();

        majTxtlblgrpii = new JPanel();

        majTxtlblgrpV = new JPanel();

        //============relamin grouping=======
        relatxtlblgrpi = new JPanel();

        relatxtlblgrpiv = new JPanel();

        relatxtlblgrpviiDD = new JPanel();

        relatxtlblgrpIIIaug = new JPanel();

        relatxtlblgrpVI = new JPanel();

        relatxtlblgrpiidd = new JPanel();

        relatxtlblgrpV = new JPanel();

        //=============paramin grouping=========
        paratxtlblgrpi = new JPanel();

        paratxtlblgrpiv = new JPanel();

        paratxtlblgrpviiDD = new JPanel();

        paratxtlblgrpIIIaug = new JPanel();

        paratxtlblgrpVI = new JPanel();

        paratxtlblgrpiidd = new JPanel();

        paratxtlblgrpV = new JPanel();

        //set layout for each groupin(txt,JLabel)======
        card.setLayout(new FlowLayout());
        majTxtlblgrpI.setLayout(new BorderLayout());
        majTxtlblgrpIV.setLayout(new BorderLayout());
        majTxtlblgrpviidd.setLayout(new BorderLayout());
        majTxtlblgrpiii.setLayout(new BorderLayout());
        majTxtlblgrpvi.setLayout(new BorderLayout());
        majTxtlblgrpii.setLayout(new BorderLayout());
        majTxtlblgrpV.setLayout(new BorderLayout());
        //============relamin grouping===============
        relatxtlblgrpi.setLayout(new BorderLayout());
        relatxtlblgrpiv.setLayout(new BorderLayout());
        relatxtlblgrpviiDD.setLayout(new BorderLayout());
        relatxtlblgrpIIIaug.setLayout(new BorderLayout());
        relatxtlblgrpVI.setLayout(new BorderLayout());
        relatxtlblgrpiidd.setLayout(new BorderLayout());
        relatxtlblgrpV.setLayout(new BorderLayout());
        //=============paramin grouping===============
        paratxtlblgrpi.setLayout(new BorderLayout());
        paratxtlblgrpiv.setLayout(new BorderLayout());
        paratxtlblgrpviiDD.setLayout(new BorderLayout());
        paratxtlblgrpIIIaug.setLayout(new BorderLayout());
        paratxtlblgrpVI.setLayout(new BorderLayout());
        paratxtlblgrpiidd.setLayout(new BorderLayout());
        paratxtlblgrpV.setLayout(new BorderLayout());
        //====================
        keychoicepan.setLayout(new GridLayout(1, 1));
        controlsig.setLayout(new GridLayout(2, 1));
        controlrelatone.setLayout(new GridLayout(2, 1));
        controlparatone.setLayout(new GridLayout(2, 1));
        controlrelasig.setLayout(new GridLayout(2, 1));
        controlparasig.setLayout(new GridLayout(2, 1));
        controlpan1.setLayout(new GridLayout(10, 3));
        majpan1.setLayout(new GridLayout(18, 1));
        relapan1.setLayout(new GridLayout(18, 1));
        parapan1.setLayout(new GridLayout(18, 1));
        relasqueeze.setLayout(new GridLayout(1, 1));
        parasqueeze.setLayout(new GridLayout(1, 1));
        //setLayout(new FlowLayout());
        //====================controlJPanel==============
        //keylbl = new JLabel ("major");
        siglbl = new JLabel(("_Major_Key_Signature_"));
        siglbl.setBorder(BorderFactory.createLoweredBevelBorder());
        relatonelbl = new JLabel(("_Relative_leading_tone_"));
        relatonelbl.setBorder(BorderFactory.createLoweredBevelBorder());
        paratonelbl = new JLabel(("_Parallel_leading_tone_"));
        paratonelbl.setBorder(BorderFactory.createLoweredBevelBorder());
        relasiglbl = new JLabel(("_Relative_Key_Signature_"));
        relasiglbl.setBorder(BorderFactory.createLoweredBevelBorder());
        parasiglbl = new JLabel(("_Parallel_Key_Signature_"));
        parasiglbl.setBorder(BorderFactory.createLoweredBevelBorder());
        reladummy1 = new JLabel((""));
        reladummy2 = new JLabel((""));
        paradummy1 = new JLabel((""));
        paradummy2 = new JLabel((""));
        //=================================
        //majlbl = new JLabel ("MAJOR");
        iLbl = new JLabel(("_I_Maj_"));
        iLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        ivLbl = new JLabel(("_IV_Maj_"));
        ivLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        viiDDLbl = new JLabel(("_vii_Half_"));
        viiDDLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        iiiLbl = new JLabel(("_iii_min_"));
        iiiLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        viLbl = new JLabel(("_vi_min_"));
        viLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        iiLbl = new JLabel(("_ii_min_"));
        iiLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        vLbl = new JLabel(("_V_Maj_"));
        vLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        //relaminlbl
        //relaminlbl = new JLabel ("Relative minor");
        iRelaLbl = new JLabel(("_i_min_"));
        iRelaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        ivRelaLbl = new JLabel(("_iv_min_"));
        ivRelaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        viiDDRelaLbl = new JLabel(("_vii_Full_"));
        viiDDRelaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        iiiAugRelaLbl = new JLabel(("_III_Aug_"));
        iiiAugRelaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        viRelaLbl = new JLabel(("_VI_Maj_"));
        viRelaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        iiDDRelaLbl = new JLabel(("_ii_Half_"));
        iiDDRelaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        vRelaLbl = new JLabel(("_V_Maj_"));
        vRelaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        //paramin
        //paraminlbl = new JLabel ("Parallel minor");
        iParaLbl = new JLabel(("_i_min_"));
        iParaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        ivParaLbl = new JLabel(("_iv_min_"));
        ivParaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        viiDDParaLbl = new JLabel(("_vii_Full_"));
        viiDDParaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        iiiAugParaLbl = new JLabel(("_III_Aug_"));
        iiiAugParaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        viParaLbl = new JLabel(("_VI_Maj_"));
        viParaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        iiDDParaLbl = new JLabel(("_ii_Half_"));
        iiDDParaLbl.setBorder(BorderFactory.createLoweredBevelBorder());
        vParaLbl = new JLabel(("_V_Maj_"));
        vParaLbl.setBorder(BorderFactory.createLoweredBevelBorder());

        //====================controlJPanel=======
        //keytxt = new JTextField (5);
        sigTxt = new JTextField(8);
        sigTxt.setFont(type);
        relaToneTxt = new JTextField(8);
        relaToneTxt.setFont(type);
        paraToneTxt = new JTextField(8);
        paraToneTxt.setFont(type);
        relaSigTxt = new JTextField(8);
        relaSigTxt.setFont(type);
        paraSigTxt = new JTextField(8);
        paraSigTxt.setFont(type);
        //====================================
        majTxt = new JTextField(18);
        majTxt.setFont(type);
        iTxt = new JTextField(14);
        iTxt.setFont(type);
        ivTxt = new JTextField(14);
        ivTxt.setFont(type);
        viiDDTxt = new JTextField(14);
        viiDDTxt.setFont(type);
        iiiTxt = new JTextField(14);
        iiiTxt.setFont(type);
        viTxt = new JTextField(14);
        viTxt.setFont(type);
        iiTxt = new JTextField(14);
        iiTxt.setFont(type);
        vTxt = new JTextField(14);
        vTxt.setFont(type);
        //JTextField relaMinTxt
        relaMinTxt = new JTextField(18);//5
        relaMinTxt.setFont(type);
        iRelaTxt = new JTextField(14);//8
        iRelaTxt.setFont(type);
        ivRelaTxt = new JTextField(14);
        ivRelaTxt.setFont(type);
        viiDDRelaTxt = new JTextField(14);
        viiDDRelaTxt.setFont(type);
        iiiAugRelaTxt = new JTextField(14);
        iiiAugRelaTxt.setFont(type);
        viRelaTxt = new JTextField(14);
        viRelaTxt.setFont(type);
        iiDDRelaTxt = new JTextField(14);
        iiDDRelaTxt.setFont(type);
        vRelaTxt = new JTextField(14);
        vRelaTxt.setFont(type);
        //JTextField paramin
        paraMinTxt = new JTextField(18);
        paraMinTxt.setFont(type);
        iParaTxt = new JTextField(14);
        iParaTxt.setFont(type);
        ivParaTxt = new JTextField(14);
        ivParaTxt.setFont(type);
        viiDDParaTxt = new JTextField(14);
        viiDDParaTxt.setFont(type);
        iiiAugParaTxt = new JTextField(14);
        iiiAugParaTxt.setFont(type);
        viParaTxt = new JTextField(14);
        viParaTxt.setFont(type);
        iiDDParaTxt = new JTextField(14);
        iiDDParaTxt.setFont(type);
        vParaTxt = new JTextField(14);
        vParaTxt.setFont(type);
        //appregio================================
        // = new JTextField amajTxt;
        aITxt = new JTextField(8);
        aITxt.setFont(type);
        aIVTxt = new JTextField(8);
        aIVTxt.setFont(type);
        aVIIDDTxt = new JTextField(8);
        aVIIDDTxt.setFont(type);
        aIIITxt = new JTextField(8);
        aIIITxt.setFont(type);
        aVITxt = new JTextField(8);
        aVITxt.setFont(type);
        aIITxt = new JTextField(8);
        aIITxt.setFont(type);
        aVTxt = new JTextField(8);
        aVTxt.setFont(type);
        // = new JTextField arelaMinTxt;
        rAITxt = new JTextField(8);
        rAITxt.setFont(type);
        rAIVTxt = new JTextField(8);
        rAIVTxt.setFont(type);
        rAVIIDDTxt = new JTextField(8);
        rAVIIDDTxt.setFont(type);
        rAIIIAugTxt = new JTextField(8);
        rAIIIAugTxt.setFont(type);
        rAVITxt = new JTextField(8);
        rAVITxt.setFont(type);
        rAIIDDTxt = new JTextField(8);
        rAIIDDTxt.setFont(type);
        rAVTxt = new JTextField(8);
        rAVTxt.setFont(type);
        // = new JTextField aparamin;
        pAITxt = new JTextField(8);
        pAITxt.setFont(type);
        pAIVTxt = new JTextField(8);
        pAIVTxt.setFont(type);
        pAVIIDDTxt = new JTextField(8);
        pAVIIDDTxt.setFont(type);
        pAIIIAugTxt = new JTextField(8);
        pAIIIAugTxt.setFont(type);
        pAVITxt = new JTextField(8);
        pAVITxt.setFont(type);
        pAIIDDTxt = new JTextField(8);
        pAIIDDTxt.setFont(type);
        pAVTxt = new JTextField(8);
        pAVTxt.setFont(type);

        //put the controls on the content pane
        add(card);
        card.add(controlpan1);
        controlpan1.add(keychoicepan);
        ////////////////////////////////////////////////keychoicepan.add(majComboBox);
        controlpan1.add(controlsig);
        controlsig.add(siglbl);
        controlsig.add(sigTxt);
        controlpan1.add(controlrelasig);
        controlrelasig.add(relasiglbl);
        controlrelasig.add(relaSigTxt);
        controlpan1.add(controlrelatone);
        controlrelatone.add(relatonelbl);
        controlrelatone.add(relasqueeze);
        relasqueeze.add(relaToneTxt, ("West"));
        relasqueeze.add(reladummy1);
        relasqueeze.add(reladummy2);
        controlpan1.add(controlparasig);
        controlparasig.add(parasiglbl);
        controlparasig.add(paraSigTxt);
        controlpan1.add(controlparatone);
        controlparatone.add(paratonelbl);
        controlparatone.add(parasqueeze);
        parasqueeze.add(paraToneTxt, ("West"));
        parasqueeze.add(paradummy1);
        parasqueeze.add(paradummy2);
        card.add(majpan1);
        majpan1.add(majTxt);
        majpan1.add(majTxtlblgrpI);
        majTxtlblgrpI.add(iLbl, ("West"));
        majTxtlblgrpI.add(iTxt, ("East"));
        majpan1.add(aITxt);
        majpan1.add(majTxtlblgrpIV);
        majTxtlblgrpIV.add(ivLbl, ("West"));
        majTxtlblgrpIV.add(ivTxt, ("East"));
        majpan1.add(aIVTxt);
        majpan1.add(majTxtlblgrpviidd);
        majTxtlblgrpviidd.add(viiDDLbl, ("West"));
        majTxtlblgrpviidd.add(viiDDTxt, ("East"));
        majpan1.add(aVIIDDTxt);
        majpan1.add(majTxtlblgrpiii);
        majTxtlblgrpiii.add(iiiLbl, ("West"));
        majTxtlblgrpiii.add(iiiTxt, ("East"));
        majpan1.add(aIIITxt);
        majpan1.add(majTxtlblgrpvi);
        majTxtlblgrpvi.add(viLbl, ("West"));
        majTxtlblgrpvi.add(viTxt, ("East"));
        majpan1.add(aVITxt);
        majpan1.add(majTxtlblgrpii);
        majTxtlblgrpii.add(iiLbl, ("West"));
        majTxtlblgrpii.add(iiTxt, ("East"));
        majpan1.add(aIITxt);
        majpan1.add(majTxtlblgrpV);
        majTxtlblgrpV.add(vLbl, ("West"));
        majTxtlblgrpV.add(vTxt, ("East"));
        majpan1.add(aVTxt);
        card.add(relapan1);
        relapan1.add(relaMinTxt);
        relapan1.add(relatxtlblgrpi);
        relatxtlblgrpi.add(iRelaLbl, ("West"));
        relatxtlblgrpi.add(iRelaTxt, ("East"));
        relapan1.add(rAITxt);
        relapan1.add(relatxtlblgrpiv);
        relatxtlblgrpiv.add(ivRelaLbl, ("West"));
        relatxtlblgrpiv.add(ivRelaTxt, ("East"));
        relapan1.add(rAIVTxt);
        relapan1.add(relatxtlblgrpviiDD);
        relatxtlblgrpviiDD.add(viiDDRelaLbl, ("West"));
        relatxtlblgrpviiDD.add(viiDDRelaTxt, ("East"));
        relapan1.add(rAVIIDDTxt);
        relapan1.add(relatxtlblgrpIIIaug);
        relatxtlblgrpIIIaug.add(iiiAugRelaLbl, ("West"));
        relatxtlblgrpIIIaug.add(iiiAugRelaTxt, ("East"));
        relapan1.add(rAIIIAugTxt);
        relapan1.add(relatxtlblgrpVI);
        relatxtlblgrpVI.add(viRelaLbl, ("West"));
        relatxtlblgrpVI.add(viRelaTxt, ("East"));
        relapan1.add(rAVITxt);
        relapan1.add(relatxtlblgrpiidd);
        relatxtlblgrpiidd.add(iiDDRelaLbl, ("West"));
        relatxtlblgrpiidd.add(iiDDRelaTxt, ("East"));
        relapan1.add(rAIIDDTxt);
        relapan1.add(relatxtlblgrpV);
        relatxtlblgrpV.add(vRelaLbl, ("West"));
        relatxtlblgrpV.add(vRelaTxt, ("East"));
        relapan1.add(rAVTxt);
        card.add(parapan1);
        parapan1.add(paraMinTxt);
        parapan1.add(paratxtlblgrpi);
        paratxtlblgrpi.add(iParaLbl, ("West"));
        paratxtlblgrpi.add(iParaTxt, ("East"));
        parapan1.add(pAITxt);
        parapan1.add(paratxtlblgrpiv);
        paratxtlblgrpiv.add(ivParaLbl, ("West"));
        paratxtlblgrpiv.add(ivParaTxt, ("East"));
        parapan1.add(pAIVTxt);
        parapan1.add(paratxtlblgrpviiDD);
        paratxtlblgrpviiDD.add(viiDDParaLbl, ("West"));
        paratxtlblgrpviiDD.add(viiDDParaTxt, ("East"));
        parapan1.add(pAVIIDDTxt);
        parapan1.add(paratxtlblgrpIIIaug);
        paratxtlblgrpIIIaug.add(iiiAugParaLbl, ("West"));
        paratxtlblgrpIIIaug.add(iiiAugParaTxt, ("East"));
        parapan1.add(pAIIIAugTxt);
        parapan1.add(paratxtlblgrpVI);
        paratxtlblgrpVI.add(viParaLbl, ("West"));
        paratxtlblgrpVI.add(viParaTxt, ("East"));
        parapan1.add(pAVITxt);
        parapan1.add(paratxtlblgrpiidd);
        paratxtlblgrpiidd.add(iiDDParaLbl, ("West"));
        paratxtlblgrpiidd.add(iiDDParaTxt, ("East"));
        parapan1.add(pAIIDDTxt);
        parapan1.add(paratxtlblgrpV);
        paratxtlblgrpV.add(vParaLbl, ("West"));
        paratxtlblgrpV.add(vParaTxt, ("East"));
        parapan1.add(pAVTxt);


    }
    ////////////////////////////////////////////
    ///////// END panels DO NOT CHANGE ///////
    ///////////////////////////////////////////

    public void setupMajbox() {

        ////////////////////////////////////////////////////////////////////
        ///////////////// combobox ///////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////

	//Combobox is populated from an xml file

        majComboBox = new JComboBox(majbox);
        majComboBox.setSelectedIndex(sel);
        majComboBox.setMaximumRowCount(16);
        majComboBox.setEditable(false);
        majComboBox.setBorder(BorderFactory.createLoweredBevelBorder());
        majComboBox.addItemListener(this);
        keychoicepan.add(majComboBox);
    }

    public void itemStateChanged(ItemEvent box) {
        key = majComboBox.getSelectedIndex();
        try {
            majBoxAttribute(key);
        } catch (ParserConfigurationException ex) {
            Logger.getLogger(KeyCards.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    public void actionPerformed(ActionEvent select) {
    }

    public void start() {
        setFont(type);
    }

    public void stop() {
    }

    public void destroy() {
    }

//attributes brought in from XML

    public void majBoxAttribute(int key) throws ParserConfigurationException {
        this.key = key;
//attribute = "cmaj";

        switch (key) {
            case 0:
                break;
            case 1:
                attribute = "cmaj";
                break;
            case 2:
                attribute = "gmaj";
                break;
            case 3:
                attribute = "dmaj";
                break;
            case 4:
                attribute = "amaj";
                break;
            case 5:
                attribute = "emaj";
                break;
            case 6:
                attribute = "bmaj";
                break;
            case 7:
                attribute = "fsharpmaj";
                break;
            case 8:
                attribute = "csharpmaj";
                break;
            case 9:
                attribute = "fmaj";
                break;
            case 10:
                attribute = "bflatmaj";
                break;
            case 11:
                attribute = "eflatmaj";
                break;
            case 12:
                attribute = "aflatmaj";
                break;
            case 13:
                attribute = "dflatmaj";
                break;
            case 14:
                attribute = "gflatmaj";
                break;
            case 15:
                attribute = "cflatmaj";
                break;
        }
        Progression p = new Progression();
        p.fillSetters();

        XMLReaderProgressions rp = new XMLReaderProgressions();
        rp.theXMLDOC(file);
        try {
            try {
                rp.readAll(attribute);
            } catch (IOException ex) {
                Logger.getLogger(KeyCards.class.getName()).log(Level.SEVERE, null, ex);
            }
        } catch (SAXException ex) {
            Logger.getLogger(KeyCards.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void showKey() {

        System.out.println("showKey sets all textfields");
        sigTxt = new JTextField();
        sigTxt.setText(strSigTxt);
        relaToneTxt = new JTextField();
        relaToneTxt.setText(strRelaToneTxt);
        paraToneTxt = new JTextField();
        paraToneTxt.setText(strParaToneTxt);
        relaSigTxt = new JTextField();
        relaSigTxt.setText(strRelaSigTxt);
        paraSigTxt = new JTextField();
        paraSigTxt.setText(strParaSigTxt);
        majTxt = new JTextField();
        majTxt.setText(strMajTxt);
        iTxt = new JTextField();
        iTxt.setText(strITxt);
        ivTxt = new JTextField();
        ivTxt.setText(strIVTxt);
        viiDDTxt = new JTextField();
        viiDDTxt.setText(strVIIDDTxt);
        iiiTxt = new JTextField();
        iiiTxt.setText(strIIITxt);
        viTxt = new JTextField();
        viTxt.setText(strVITxt);
        iiTxt = new JTextField();
        iiTxt.setText(strIITxt);
        vTxt = new JTextField();
        vTxt.setText(strVTxt);

        //textfield relamin
        relaMinTxt = new JTextField();
        relaMinTxt.setText(strRelaMinTxt);
        iRelaTxt = new JTextField();
        iRelaTxt.setText(strIRelaTxt);
        ivRelaTxt = new JTextField();
        ivRelaTxt.setText(strIVRelaTxt);
        viiDDRelaTxt = new JTextField();
        viiDDRelaTxt.setText(strVIIDDRelaTxt);
        iiiAugRelaTxt = new JTextField();
        iiiAugRelaTxt.setText(strIIIAugRelaTxt);
        viRelaTxt = new JTextField();
        viRelaTxt.setText(strVIRelaTxt);
        iiDDRelaTxt = new JTextField();
        iiDDRelaTxt.setText(strIIDDRelaTxt);
        vRelaTxt = new JTextField();
        vRelaTxt.setText(strVRelaTxt);
        //texfield paramin
        paraMinTxt = new JTextField();
        paraMinTxt.setText(strParaMinTxt);
        iParaTxt = new JTextField();
        iParaTxt.setText(strIParaTxt);
        ivParaTxt = new JTextField();
        ivParaTxt.setText(strIVParaTxt);
        viiDDParaTxt = new JTextField();
        viiDDParaTxt.setText(strVIIDDParaTxt);
        iiiAugParaTxt = new JTextField();
        iiiAugParaTxt.setText(strIIIAugParaTxt);
        viParaTxt = new JTextField();
        viParaTxt.setText(strVIParaTxt);
        iiDDParaTxt = new JTextField();
        iiDDParaTxt.setText(strIIDDParaTxt);
        vParaTxt = new JTextField();
        vParaTxt.setText(strVParaTxt);

        //appegio==========================
        // amajTxt.setText(");
        aITxt = new JTextField();
        aITxt.setText(strAITxt);
        aIVTxt = new JTextField();
        aIVTxt.setText(strAIVTxt);
        aVIIDDTxt = new JTextField();
        aVIIDDTxt.setText(strAVIIDDTxt);
        aIIITxt = new JTextField();
        aIIITxt.setText(strAIIITxt);
        aVITxt = new JTextField();
        aVITxt.setText(strAVITxt);
        aIITxt = new JTextField();
        aIITxt.setText(strAIITxt);
        aVTxt = new JTextField();
        aVTxt.setText(strAVTxt);

        //arelaMinTxt.setText(");
        rAITxt = new JTextField();
        rAITxt.setText(strRAITxt);
        rAIVTxt = new JTextField();
        rAIVTxt.setText(strRAIVTxt);
        rAVIIDDTxt = new JTextField();
        rAVIIDDTxt.setText(strRAVIIDDTxt);
        rAIIIAugTxt = new JTextField();
        rAIIIAugTxt.setText(strRAIIIAugTxt);
        rAVITxt = new JTextField();
        rAVITxt.setText(strRAVITxt);
        rAIIDDTxt = new JTextField();
        rAIIDDTxt.setText(strRAIIDDTxt);
        rAVTxt = new JTextField();
        rAVTxt.setText(strRAVTxt);
        //Car. aparamin);
        pAITxt = new JTextField();
        pAITxt.setText(strPAITxt);
        pAIVTxt = new JTextField();
        pAIVTxt.setText(strPAIVTxt);
        pAVIIDDTxt = new JTextField();
        pAVIIDDTxt.setText(strPAVIIDDTxt);
        pAIIIAugTxt = new JTextField();
        pAIIIAugTxt.setText(strPAIIIAugTxt);
        pAVITxt = new JTextField();
        pAVITxt.setText(strPAVITxt);
        pAIIDDTxt = new JTextField();
        pAIIDDTxt.setText(strPAIIDDTxt);
        pAVTxt = new JTextField();
        pAVTxt.setText(strPAVTxt);

    }

    public String[] getMajbox() {
        return majbox;
    }

    public void setMajbox(String[] majbox) {
        this.majbox = majbox;
        for (int i = 0; i < majbox.length; i++) {
            //System.out.println("In the GUI keys of the majbox[" + i + "] " + majbox[i]);
        }
    }
}

Are those JTextFields? If so, setText is the right method.
http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html

Are you sure your text fields are properly initialized and added to the panel? Can you post a bit more code showing where this is done? And have you taken similar steps in your code as I have in this example:

package kyle;

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

public class TextFieldTest {

	static JTextField field = new JTextField("text here!!");
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		JFrame frame = new JFrame("Text Field Test");
		JPanel panel = new JPanel();
		panel.add(field);
		frame.add(panel);
		frame.setVisible(true);
		frame.setSize(250,250);
		
		try {
			Thread.currentThread().sleep(3000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		field.setText("different text now.");
	}

}

(Ignore bad usage of Thread.sleep, etc, that was just a quick example - I'm referring to whether or not you added your panel to your frame, otherwise your text fields won't show to begin with. Can you see your text fields to begin with?)

Well, without digging into it thoroughly, I won't be able to help (considering the size of the code), so I'll get back to you tomorrow. If I forget to get back to you, don't hesitate to PM me with a link to this thread (sometimes if I don't see the link, I forget about it). The names of the variables aren't really that important for digging through it, I can always do a search if I see something strange, but it seems like your issue is unrelated to the text field and may be caused by errors with your other components.

Oh, and in the future, for code of this length, it is better to just attach the file, or if someone requests to run your code on their machine. If you see this before I get back tomorrow could you do that?

Edited 6 Years Ago by BestJewSinceJC: n/a

I really apreciate the help.

Hopefully this answers a lot of questions concerning using objects without creating new ones. This is the first time I used extends and yet to use super.

anyway I have the entire project if it makes the gui mess easier.
I have moved the 200 line switch statement to xml lol so it is not as bad as it was. Learning JDOM.

that is how I know all the fields used to work perfect. I have not changed the layout.

I just opened your project and it seems to be more of a "JDOM mess" than a "GUI mess". I have little experience with JDOM, although I do have some. I'll look at your code as promised but if it turns out to be a problem within your JDOM code, I doubt I can help. If it is a problem within any Swing code I'll probably be able to help. Looking into it now..

Ok, I'm noticing a couple of issues.

You only need to instantiate your JTextFields once. In your showKey() method, you are instantiating them over and over again. (i.e. you are saying textField = new JTextField() every time showKey() is called). To remedy this situation, I am moving all the instantiations of your JTextField Objects to a method called initKeys(), and I'm going to make sure that you only call initKeys() once in your code.

Why does your Progression class extend KeyCards? I see that you're calling showKey() from within the Progression class, however, any Progression Object that you created has a different set of text fields (and other variables) than your KeyCards Object does. So the showKey() call from within your Progression class has no affect on your KeyCards Object that you created from within your createAndShowGUI() method in your XMLReaderComboBox class.

Edited 6 Years Ago by BestJewSinceJC: n/a

Ok, sorry for so many posts, but I'm only allowed to edit for 30 minutes, which I've exceeded. I fixed your classes so that when you click on the combo box, it updates the text fields with the default text that you had there. So now that works. I'm going to let you struggle with it a little bit more though. Keep in mind my suggestions, particularly the second suggestion in my previous post:

Your Progression Object that you created and your KeyCards Object that you created do not have the same JTextFields. So when you were updating the Progressions' JTextFields, which were not on the GUI, the GUI's JTextFields (which were from the KeyCards Object) were not being updated.

Here is your code with the changes I made to it. The changes I made to it are primary passing the KeyCards Object to your Progression class's showKey method, so look for the method

showKeys(KeyCards kc) //in Progression class

I just opened your project and it seems to be more of a "JDOM mess" than a "GUI mess". I have little experience with JDOM, although I do have some. I'll look at your code as promised but if it turns out to be a problem within your JDOM code, I doubt I can help. If it is a problem within any Swing code I'll probably be able to help. Looking into it now..

I think you will not have to worry about the JDOM because it stops
before any thing happens then it is all hard coded.

but I will attach the new XMLReaderProgression.java. you can change out that class. You can see how easy JDOM is. Well it will be for you but I am fighting it now.
It won't affect operation just interesting JDOM System.out
Thanks again

Attachments
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package keycardsxml;

/**
 *
 * @author depot

 */
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.ParserConfigurationException;


import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.jdom.Attribute;
import org.jdom.Document;
import org.jdom.Element;
import org.xml.sax.SAXException;

public class XMLReaderProgressions extends KeyCards {

    public Progression p;
    private String name;
    public Document doc;
    public Element e;
//experimenting with jdom when the combox is clicked

    public XMLReaderProgressions() {
    }

    public void readAll(String name) throws ParserConfigurationException, SAXException, IOException {
        this.name = name;
        SAXBuilder builder = new SAXBuilder();
        try {
            Document doc = (Document) builder.build(file);
            listElements(doc.getRootElement());
        } catch (JDOMException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(XMLReaderProgressions.class.getName()).log(Level.SEVERE, null, ex);
        }


    }

    public void listElements(Element e) {

        if (e.getName().equals("keyName")) {

            List a = e.getAttributes();
            for (Iterator i = a.iterator(); i.hasNext();) {
                Attribute kna = (Attribute) i.next();
                if (kna.getValue().equals(name)) {
                    System.out.println("* Element, name: " + e.getName() + ", Attribute: " + kna.getValue());
                    listChildElements(e);
                }
            }
        }//end .equals("keyName")
        List c = e.getChildren();
        for (Iterator i = c.iterator(); i.hasNext();) {
            Element n = (Element) i.next();
            listElements(n);
        }
    }//listElements()

    public void listChildElements(Element e) {
         System.out.println("*Child name: " + e.getName());
        List c = e.getChildren();
        int l=c.size();
        System.out.println("there are: "+l+" children");
        for (Iterator i = c.iterator(); i.hasNext();) {
            Element n = (Element) i.next();
            System.out.println("*Child: "+n.getValue());
            listChildElements(n);
        }//end for


    }//end listChildElements()

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

I explained to you what I think the problem is. You have two different Objects, a Progression Object and a KeyCards Object. Your code that you gave me had a showKeys method in KeyCards, and another showKeys method inside Progression. When you call the showKeys method in Progression, it does not modify anything on your GUI because your GUI contains a KeyCards Object. You can solve this problem by looking at the modified code I posted for you. I'm not going to fix the whole project for you, that would not be helping you learn. But if you look at my previous post, you will be able to figure out the problem with your code, which as I said, deals with the Progression Object and KeyCards Object being separate and not affecting one another. So import the project I provided you with into Eclipse and take a look.

Edited 6 Years Ago by BestJewSinceJC: n/a

I'm not sure yet but I think I've been trying to learn the concept of
your

showKeys(KeyCards kc) //in Progression class

for a very long time.
Thank you for getting it to work. That is encouraging. I will have to try to understand it now.
Thank you Thank you lol and Thank you.

Hello again
Man scrolling through that KeyCards.java post takes forever...sorry

I couldn't wait so I fixed my classes.

now
the call to set the textFields

Progression p = new Progression();
fillSetters(this);

comes from within keycards.java now.
so it is passing "this" meaning global (the keycards object)
and it goes all the way to showKey(KeyCards kc) ?

The 'this' keyword refers to whatever Object called the method. So if you have the following code:

public static void main(String[] args){
KeyCards c = new KeyCards();
c.callSomeMethod();
}

Inside callSomeMethod, 'this' will refer to 'c'.


So yes, if you are inside a method of the KeyCards class (that isn't a static method), then 'this' is going to refer to the KeyCards Object that you called that method with.

http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html

Edited 6 Years Ago by BestJewSinceJC: n/a

This question has already been answered. Start a new discussion instead.