Interrupted Exception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Interrupted Exception

Kenneth R Sloan-2
On of my colleagues reports the following error:


When this happens, I'm fairly sure the code is in a tight loop:

while(true)
{
  keyTyped = false;
  while(!keyTyped) win.requestFocus();
  ...process key...
}

keyTyped is global, and is set by:

public void keyTyped(KeyEvent e)
{
 keyChar = c.getKeyChar();
 keyTyped = true;
}

As you can see, he's running on a Windows 10 machine.  I can't reproduce on my MacBook Pro.

I need two types of advice:

a) what might cause this

b) what's the best way to catch (and dismiss?) these.  More to the point - if I insert code to catch the Exception, how can I *cause* the exception (in order to test)?


--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.






--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Screen Shot 2020-07-01 at 19.59.03.png (83K) Download Attachment