I have one applet where i can save and delete some data.
When one item is selected and the "delete" button i pressed, i open a new frame/window with a dialogbox where the user is asked " Are you sure you want to delete the current record?". Then the user can click on either yes or no. When the button is clicked i set the boolen "save" to true/false.
The problem is to get this value to the main applet..
i have tried made the function
boolean getAnswer() {
return save;
}
in the dialogapplet dialogBox
and tried with this function in the main applet
dialogBox box = new dialogBox(new Frame);
System.out.println(box.getAnswer);
the problem is that it looks like that box.getAnswer is reviced before I have clicked yes or no.. and therefore it always are set as false.
How do i make the main applet wait to get the value to i have closed the dialog window?
Jørn Arild Andenæs
When one item is selected and the "delete" button i pressed, i open a new frame/window with a dialogbox where the user is asked " Are you sure you want to delete the current record?". Then the user can click on either yes or no. When the button is clicked i set the boolen "save" to true/false.
The problem is to get this value to the main applet..
i have tried made the function
boolean getAnswer() {
return save;
}
in the dialogapplet dialogBox
and tried with this function in the main applet
dialogBox box = new dialogBox(new Frame);
System.out.println(box.getAnswer);
the problem is that it looks like that box.getAnswer is reviced before I have clicked yes or no.. and therefore it always are set as false.
How do i make the main applet wait to get the value to i have closed the dialog window?
Jørn Arild Andenæs