hi,
this might be a programming logic problem
the scenario is,
i have a label with imageIcon and two buttons, A and B.
the label (with imageIcon) is representing the value of a randomed integer from 1 until 6 (a dice actually).
when a user pressed button A, the image of the label will keep changing
as the dice is randomed.
it will be stopped when user pressed button B.
i've tried using recursion, but it's failed as it raise the StackOverflow exception.
should i use something like a sleep function?
is there any other solution, i hope a simple solution (no threading things)
thank you.
this might be a programming logic problem
the scenario is,
i have a label with imageIcon and two buttons, A and B.
the label (with imageIcon) is representing the value of a randomed integer from 1 until 6 (a dice actually).
when a user pressed button A, the image of the label will keep changing
as the dice is randomed.
it will be stopped when user pressed button B.
i've tried using recursion, but it's failed as it raise the StackOverflow exception.
should i use something like a sleep function?
is there any other solution, i hope a simple solution (no threading things)
thank you.
Comment