I have this class but in java is txt actually a new JTextField() if the name is changed?
this creates a form from any JTable Model.
Is it possible to get unique txt.getText(); from txt fields if the txt.setName() is unique?
I am just trying to understand why that code shown makes new labels with the (unique) text
for every column in the in the table and it is paired with a JTextField and the display
shows all the new display objects just like a form.
I was trying to find out if this code could collect the txtfield.getText().
It just makes a new object on the screen for any number of columns but how is one different from the other so I can always get the txt for each.
I just confused because in flash (actionSript) you can create on object and use it 1500
different ways and you can change the name for each and then manipulate any given object by the name related to it.
how is one different from the other so I can always get the txt for each.
You can get to each textfield/object by saving a reference to it. Usually there is a variable name associated with each object. But in some cases you store the references to an object in some "container" like an array or Map. Then to get to the object you need to get the reference from that "container".
TextField tf = new TextField(); // create variable (tf) and an object
tf now refers to a textfield
TextField tfArray = new TextField; // create an array to hold references
tfArray = tf; // save reference to object created above
tf = null; //now tf does NOT refer/point to the object created above
tf = tfArray; // now tf again refers/points to the object created above
I'm like-in that. thanks.
I have not ever bothered to actually use a array for java.
I have been trying to comprehend if your example would be better to use a array. txtGetNameArray=new String[numberOfColumns] Because at the actionPerformed() would it be possible to load a reference to all the txt fields and the getText() they hold. I will have to use your example first to know if that is even necessary.
Thanks,your example will save a lot of time. Before your example I was trying to find a excuse to actually use a multi-dementional array. I have never really wrapped my brain around how it works.
I just started learnng the art of JTable. Isn't that all a JTable is at its root?