refreshing a Textfield

We have a textfield we were talking about in a earlier question.
when the dialog first opens that field has not value assigned to it.  Let me show what the dialog looks like.

Project:  [ jtext   ]  [ change button ]

When the dialog is first opened jtext has not value.  But when the user clicks the change button that open another dialog.  It is when the dialog is opening we get the value for jtext.

 
private void showProjectSelectDialog() {
      EdiSelectProjectDialog ar = new EdiSelectProjectDialog(this, session, appReg);
	  ar.setModal(true);
	  ar.setVisible(true);
	  EdiProject newProject = ar.getSelectedProject();
	  if (newProject != null) {
		  currentProject = newProject;
		  curProject = new JTextField(20);
		  curProject.setText(currentProject.getName());
		  curProject.setEnabled(false);
		  
	  }
	  else {
		  System.out.println("No Project\n");
	  }
   }

Open in new window


The user from the new dialog can select a different project.  The dialog goes away, but I am not sure how to update the jtextfield to show the new value.  Is there a refresh? or some kind of listener?
jkteaterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

for_yanCommented:
You don't need any refresh. The moment you cal setText JTextFiled shoud show thge contents
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
for_yanCommented:
Make sure you pass to the neew JDialog handle to your original class correctly, so thaat you can acces the JTextField
You can make a method in the original class for setText on this JText field and call it from your dialog as soon as user made a selection
0
CEHJCommented:
Make lines 3 and 4of your code  the last lines of the method
0
CEHJCommented:
Oops sorry - was misreading. My previous comment just applies to line 3
0
CEHJCommented:
jkteater, the accepted answer implies that you don't need to change any of your code to get it to do what you want - is that the case?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.