This newbie needs some help from the 'old hands'.
Context: The task of the small program is to display a worldmap image and then to read some data files with vector data to be drawn on top of the image. The approach (mostly plagiarized from "Just
Java 2") is to:
instantiate a JFrame
instantiate a JPanel
instantiate an ImageIcon with the background map image
instantiate a JLabel using the ImageIcon
add the JLabel to the JPanel
add a KeyListener using KeyAdapter
add the JPanel to the JFrame (whew!)
The problem is that the KeyListener is sometimes deaf (doesn't respond to keystrokes). Strangely, the likelihood of the problem is affected by whether the Java graphics window is initially the "top" (Active) window (let's call that case "A" for Active) or is Below (case "B") another window such as Netscape. The KeyListener is almost always deaf in case A but almost never in case B.
Any helpful suggestions would be most appreciated. Included here is the complete (but stripped down) code.