Can anyone explain me why shouldn't i use paint
method to draw directly inside a JFrame
window, and i should use paintComponent
method with a JPanel
inside the JFrame
?
Thanks in advance.
Three main reasons...
For point #2, frame decorations are painted WITHIN the "window" bounds, not outside them
Take a look at...
for more details
Make the time to read through Painting in AWT and Swing and Performing Custom Painting for more details