Dynamic JTextFields Help
Having a slight problem displaying dynamic JTextFields in my java app. Problem as follows:
A user selects an item from a combo box and presses 'ok'. All the details of that item (stored in a dbase) need to then be displayed in JTextFields on the interface. The number of JTextField required is dependent on the number of columns in the table which holds details on the item which has been choosen by the user.
My problem is that after i have retrieved all the details and set the JTextFields with the data - it doesnt seem to display the fields on the screen!
I have tried a number of ways - the latest way is shown below in the code snippet:
private void selectRiskReview(){
// gets all details of the item selected from dbase
ResultSet rs = d.getRiskDetails (c.colRiskID + " = " + r.getRiskID ());
// retrieves the number of columns = number of jtext field required
Integer noCols=d.getNoOfCols (rs);
try{
while(rs.next()){
for (int i=1; i<noCols+1; i++){
String fieldName = "jDynamicText" + i;
JTextField tName = new JTextField();
tName.setName (fieldName);
tName.setText (rs.getString(i));
tName.setVisible(true);
jReviewScreen.add(tName);
}
}
} catch (SQLException e){
System.out.println (e);
}
jReviewScreen.repaint();
jReviewScreen.setVisible (true);
}
Any ideas why the newly added text fields are not showing?
Any help will be v much appreciated!
Thanks in advance!
ev

