return value from GUI

R

Richmond

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.
 
R

Richmond

Someone can help me!? How can I read the value...or where is my error?
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 ;)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top