This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Frame and Dialog problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Frame and Dialog problem" Watch "Frame and Dialog problem" New topic
Author

Frame and Dialog problem

tee ming
Greenhorn

Joined: Jul 11, 2001
Posts: 8
I have a program consists of 1 frame and 1 diolog, how can i link them together so that i can get the value in Dialog and set it into textField in Frame.
SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
From your JFrame code, make a call like this...
String value = JOptionPane.showInputDialog(....)
You dont need to create your own custom dialog since JOptionPane does it for you. The method showInputDialog() is overloaded to accomodate different arguments, such as dialog title, dialog message, etc. In any event, a call to this static method will display a dialog window to the user with a text field to enter data. After the user clicks OK, the data they entered in the text field will be assigned to the 'value' variable in the code snippet above.
Hope it helps
SAF
tee ming
Greenhorn

Joined: Jul 11, 2001
Posts: 8
Hi SAF,
I can't use the default dialog box because my dialog box need to have more than 1 textField and a passwordField. So can you help me solve the previous probelm, Thanks!
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

"teeming"
your name is not in accordance with the javaranch guidelines.
Please take a moment and re-register after selecting a valid
name. you can find the guidelines at http://www.javaranch.com/name.jsp
thanks for your cooperation.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Frame and Dialog problem
 
Similar Threads
Observer & Observable
How to Remove Java Icon
clarification about Dialog container
Can anyone please hurry help me?!?!?!?
Some observations regarding Containers.