The issue has nothing to do with Windows 8, but the fact that you've overridden paint
of a top level container.
The frame border is painting within the bounds of the window.
A frame has a content pane which should be used to layout the contents or perform custom painting.
Instead of overriding paint
of the top level container, create your self a custom component (extending from something like JPanel
) and override it's paintComponent
method.
You can then either add it to the frames content pane or replace the frames content pane
Check out...
- Performing Custom Painting
- Painting in AWT and Swing
- Java graphic image
- How can I set in the midst?
- How to get the EXACT middle of a screen, even when re-sized
- Graphics rendering in title bar
For further explanations