I have got a JPanel
with a dimensions x,y. What im doing is a drawing an moving image with paintComponent()
and Graphics2D.drawImage()
metods. I want to ask, how to draw one part of image on one side of panel and part on second part on 2nd side of my panel when it will move my image to the edge of JPanel
. What i want to do is for example:
my image has got dimensions 20,20
my panel has got dimensions 100,100
when i move my image to position 90,10 (x,y) i want to draw half of my image on position 90,10 and 2nd half on position 0,10