This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
1. You added the listener to the frame so the coordinates a relative to the frame, which included the title bar. The component is added to the content pane of the frame so the coordinates are different. Add the listener to the content pane:
2. For a component the location is the top/left and the component is painted below that point. To paint above the point you need to adjust the "Y" value:
Maneesh Godbole wrote:The proper way to build your UI is using layout managers.
The first problem i ran into was using the layout manager. It placed the JLabel on the west side of the page so I set it to null. That's why i'm not using a layout manager.
Even though they're meant to help.