How to draw a diamond shape in java?
问题 So i have to draw a diamond shape. Not a Static diamond but a diamond that i will myself drag and draw. I've used General Path to do it but it is drawing a diamond that is not straight; the diamond is bend to the left and it's not being drawn to where my mouse is pointed. Here is my code to create the diamond shape. Can someone please help me solve this? private GeneralPath drawDiamond(int x1, int y1, int x2, int y2){ int x = Math.min(x1, x2); int y = Math.min(y1, y2); // Gets the difference