Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help !! Extracting multiple input from a customized JDialog box  RSS feed

 
Karl Fu
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a custom JDialog box with radio buttons with textFields attached to it. Given any selected radio buttons, only its dependent textfield are enabled(allow input).
i.e.
i added 2 radio button("A","B") and 2 textfields("a","b") as their dependent component onto JDialog's box pane.
when "A" is selected, "a" is enabled, "b" is disabled.
I am stuck now in how to return values in this particular JDialog box.
Thanks in advance
Karl
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karl,
As a first step create a class that contains all the information that might come from the dialog (DialogData). Once you have that you can use it to both send and recieve data from your dialog.

The class who puts up the dialog might have some code that looks like the following.

A full blown example would be to long for this forum.
Regards,
Manfred.
 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the data from your Dialog is just from radio buttons and text fields, it probably isn't complex enough to need it's own class. That seems like overkill to me. Just create a method that returns the data, like getInputText().
 
Karl Fu
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your advises..I find the anwser

 
Karl Fu
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your advises..I find the anwser

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!