I'm making a game for my software design class. I have a JPanel set up where I drag and drop these 100x100 pixel JLabels around the screen (the game is essentially a puzzle that snaps these labesls to locations on my panel). My professor says that he'd prefer I not use JLabels, so I need some advice on what you all think I could use. I need an object that:
I can size to 100x100 pixels
I can set an on click mouse listener
I can change the location of it in the JPanel based on an (x,y) pair (in pixels)
And, finally, I need to draw some lines on top of it. So, based on four values (x0,y0,x1,y1). I need to draw a solid line from a pixel point on the square, say from (0,50) to (50, 50). Would look something like: (with multiple lines)
Example Square:
Any suggestions? Also, any help on where to find how to draw on top of these projects?
Thanks!