Why not to draw directly inside JFrame [duplicate]
This question already has an answer here: Difference between paint() and paintcomponent()? 2 answers 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. MadProgrammer Three main reasons... Top level containers aren't double buffered, which cause flickering when the frame is repainted, yes, you can implement you're own double buffering, but... Painting inside a frame does not take into consideration the frames borders, meaning that it's possible to paint under