Canvas fillRect() not filling defined canvas
问题 I am extending a Canvas and adding it to a JFrame . I understand that AWT and Swing should not be mixed and that drawing on JPanel is preferred but i'm trying to follow a game engine tutorial and i'd like to stick to it since I got it working so far. The Canvas has minimumSize , maximumSize , and prefferedSize set to the dimensions of 550, 400 . When I do a draw call graphics.draw(0,0,550,400) it doesn't fill the entire screen as it should. I changed the draw call to graphics.draw(0,0,560,410