I am working on a java framework, were I create my own buttons and so on and I tried to draw everything on the frame by using a canvas and Graphics2D. But when I draw small rect