Java Reference
In-Depth Information
Display 19.1
Nonresponsive GUI (part 3 of 3)
Resulting GUI (When started)
Resulting GUI (While drawing circles)
If you click the close-window button
while the circles are being drawn,
the window will not close until all
the circles are drawn.
Resulting GUI (After all circles are drawn)
can sometimes be handy even if you do not do any
multithreaded programming. The class
The method
Thread.sleep
is in the package
and so
Thread
java.lang
requires no import statement.
The method
can throw an
, which is a
Thread.sleep
InterruptedException
checked exception—that is, it must be either caught in a
block or declared in a
catch
in this topic, leaving it for
more advanced topics on multithreaded programming, but it has to do with one thread
interrupting another thread. We will simply note that an
clause. We do not discuss
throws
InterruptedException
may
InterruptedException
 
Search WWH ::




Custom Search