Chapter 16

Java's Juggling Act

IN THIS CHAPTER

Bullet Creating code to handle mouse clicks

Bullet Responding when the user presses a key or selects a drop-down box item

Bullet Putting classes inside other classes

Study after study shows how people perform poorly when they try to multitask. I occasionally attend two online presentations at the same time. I set up two computers, each with easily adjustable volume controls. My plan is to pivot my attention between the two computer screens, changing the volumes, moment by moment, in response to the importance of what's being presented.

This plan never works. Rather than follow both presentations, I end up following neither of them.

Most people can't concentrate on two tasks at a time, but some people can. A study at the University of Utah found that about 1 in x 40 people is a supertasker — someone who can drive a simulated vehicle, talk on a phone, memorize words, and do mental arithmetic all at the same time.* A series of fMRI scans has shown that supertaskers' brains don't race to keep up with all the input they receive.** Instead, their brains tune down the logical thinking and turn up the relaxing thoughts. The regions in their brains that are responsible ...

Get Java For Dummies, 8th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.