Tom Gone
October 11th, 1999, 11:48 AM
Hiya (again I guess :),
I have another little "problem" which I'm looking for pointers to. Basically what I want to do is to create a dataentry window which is created by another window. The first window asks the user how many data items they want to enter (for example 2 persons and 4 items), this then creates the second window which then has a corresponding layout. In the example here, I would want something like this
Item Person1 Person2
#1 JTextField JTextField
#2 JTextField JTextField
#3 JTextField JTextField
#4 JTextField JTextField
where the titles, and the #1 etc are all JLabels. I can do the first window no problems, and I can do this second window as well. However my problem is that as I create the JTextFields dynamically I cant give them names, so I dont know how to access the information in them?!? In theory I could end up with any number of columns * any number of rows.
I am just implementing it using a JTable, but dont like that solution very much. Any idea of 1. which is the better way to do it (the labels etc should not be changeable) and 2. how can you get at the text in the JTextField if implemented as I proposed above?
I have played with using Vectors for the JTextFields etc, but its a very clumpsy solution.
Cheers as always for any pointers
Thomas
I have another little "problem" which I'm looking for pointers to. Basically what I want to do is to create a dataentry window which is created by another window. The first window asks the user how many data items they want to enter (for example 2 persons and 4 items), this then creates the second window which then has a corresponding layout. In the example here, I would want something like this
Item Person1 Person2
#1 JTextField JTextField
#2 JTextField JTextField
#3 JTextField JTextField
#4 JTextField JTextField
where the titles, and the #1 etc are all JLabels. I can do the first window no problems, and I can do this second window as well. However my problem is that as I create the JTextFields dynamically I cant give them names, so I dont know how to access the information in them?!? In theory I could end up with any number of columns * any number of rows.
I am just implementing it using a JTable, but dont like that solution very much. Any idea of 1. which is the better way to do it (the labels etc should not be changeable) and 2. how can you get at the text in the JTextField if implemented as I proposed above?
I have played with using Vectors for the JTextFields etc, but its a very clumpsy solution.
Cheers as always for any pointers
Thomas