ActionListener listener = new ActionListener()
{
@Override public void actionPerformed(ActionEvent e)
{
boolean isfin = false;
do {
NSplitFrame += NSplitFrameInc;
if (NSplitFrame < 4 || NSplitFrame > 12)
{
NSplitFrame = 8;
NSplitFrameInc = -NSplitFrameInc;
}
}while(isfin);
}
};
displayTimer = new Timer(200, listener);
displayTimer.start();
with or without the do :: while every once in a while I get a ArrayOutOfBoundsException due to NSplitFrame being > 12. Is there a way to make sure that this listener has completely finished while the values are being changed?