IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes data return between actionPerformed Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "data return between actionPerformed" Watch "data return between actionPerformed" New topic
Author

data return between actionPerformed

Paddy Totti
Greenhorn

Joined: Dec 12, 2001
Posts: 9
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

Joined: Jan 09, 2001
Posts: 1492
Hi Paddy,
Have a look at the JOptionPane. This link should help you.
Regards,
Manfred.
 
IntelliJ Java IDE
 
subject: data return between actionPerformed
 
Threads others viewed
Question about actionPerformed
extending JFrame vs having JFrame as a field
Communication between JFrames
Question about actionPerformed
Extra window appearing when JFrame is made visible
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture