If I run my program. a GUI shows.
clicking the combox. calls a series of classes that produce what text needs to be in the textfields
so one of the classes calls fillSetters which is in a class that extends the GUI so "this" should be an instance of the GUI.

could someone who knows OOP show me how to minipulate my GUI without creating a new one.
nothing goes into the text fields.

I put all 4 classes 1600 lines of code into the GUI and it worked. I don't want it that way though.

public void fillTextBox(){
         initTextFields(this);
        showKey(this);

       
    }

   
    public void showKey(KeyCards kc) {




        kc.sigTxt.setText(strSigTxt);
        
    }
    
     public void initTextFields(KeyCards kc) {
         
        kc.sigTxt = new JTextField();
        
       
       

    }

Recommended Answers

All 5 Replies

Sorry to break this to you, but it isn't OOP if you don't use objects.

It might help to see more code, then again, if you are creating new textfields every time you want to place a value in one, that is your problem, and judging by the name of the first method that appears to be what you are doing.

Ok I really don't know.

I run the program and a class keycard.java creates a gui with a combobox an 51 text fields and labels.

I leave that class when the combo box is selected.

I can never go back to that class because if I do I have to use
KeyCards kc = new KeyCards(); which create What?

Sorry, but at this point you need a tutor, if not a real teacher. A forum is not going to help.

Actually I already know that that creates a new keycards object.

what I don't understand is how to set the text fields in the orignal keycard object from another class.

ok thanks anyway. later

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.