//store off existing components
Component[] existing = new Component[passwordRow.getComponentCount()];
for(int i=0; i<passwordRow.getComponentCount();i++){
existing[i] = passwordRow.getComponent(i);
}
passwordRow.removeAll();
for(int j=0;j<existing.length;j++){
if(j==1){//insert new JTextField instead
passwordRow.add(updatedContainer);
}else{
passwordRow.add(existing[j]);