return value from GUI

Discussion in 'Java' started by Richmond, Jun 25, 2007.

  1. Richmond

    Richmond Guest

    Hi,
    I'm modelling a sw that synchronize two directories, a part of it
    must be interactive and I have a "problem".

    In the algorithm of synchronization when I encounter a difference
    between the two directories I ask to the user what he will do, I call
    a JDialog and I need to read an int value representing the choise
    (ignore, copy A to B, delete, ...).

    The OK button of the Gui set in actionPerformed the value (selected
    button), in the same class I put a method getChoosedValue that return
    the int value...now, when i call the getChoosedValue() on the
    guiRequestPolicy don't happen nothing.

    I explain it better:
    <pre>
    if (!matchEqualsMethod) {
    guiRequestPolicy.setVisible(true);
    //here I need to set the int value
    chooseValue =
    guiRequestPolicy.getChooseValue();
    //then do the request policy
    this.processInteractivePolicy(chooseValue,
    tmpCheckFileBD, tmpCheckFileSD, confrontPolicy, checkFileFilter,
    logFile);
    }
    </pre>

    Someone can help me!? How can I read the value...or where is my error?
    I hope I was precise explaining my problem, thanks.
    Richmond, Jun 25, 2007
    #1
    1. Advertising

  2. Richmond

    Roedy Green Guest

    On Mon, 25 Jun 2007 09:57:20 -0000, Richmond
    <> wrote, quoted or indirectly quoted
    someone who said :

    >Someone can help me!? How can I read the value...or where is my error?
    >I hope I was precise explaining my problem, thanks.


    Normally this sort of thing is done with a JOptionPane.

    See http://mindprod.com/jgloss/joptionpane.html
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jun 25, 2007
    #2
    1. Advertising

  3. Richmond

    Richmond Guest

    > >Someone can help me!? How can I read the value...or where is my error?
    > >I hope I was precise explaining my problem, thanks.

    >
    > Normally this sort of thing is done with a JOptionPane.


    I solved it setting the JDialog modal, so the method getChoosedValue()
    has to wait since the dialog is open...thank you for the help and the
    quick answer ;)
    Richmond, Jun 26, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PvdK
    Replies:
    0
    Views:
    2,978
  2. paul.foreman

    GUI - GUI value passing

    paul.foreman, Oct 22, 2004, in forum: Java
    Replies:
    5
    Views:
    751
    Michael Rauscher
    Oct 25, 2004
  3. Seong-Kook Shin
    Replies:
    1
    Views:
    491
    Richard Bos
    Jun 18, 2004
  4. ulysses
    Replies:
    4
    Views:
    764
    Werner Schiendl
    Oct 22, 2003
  5. Greenhorn
    Replies:
    15
    Views:
    815
    Keith Thompson
    Mar 6, 2005
Loading...

Share This Page