I want to write an application that will load an image into JPanel and the user will able to select a rectangle from the image. I mean that the user will be able to click on the image and drag the mouse until he gets his preferred rectangle from the shown image. During this process a red border will be shown and updated for the selected area. After it, I will have the rectangle coordinates.