Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

data return between actionPerformed  RSS feed

 
Paddy Totti
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I has a main program which is JFrame, when a button click, I call another class to exlpore a Jframe which contain a textfield. My idea is when enter something in that textfield, the value can be stored,then that Jframe close, and then main program can get that value. However, this is not practical because the function in main class that call the second JFrame will end without waiting user enter value:
//this class prompt user enter text
TJPasswordField myField = new TJPasswordField();
System.out.println(myField.textValue);
This will print null each time because the class will end before user enter value.
So, anyone have a solution to this SIMPLE problem ???
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paddy,
Have a look at the JOptionPane. This link should help you.
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!