Recently I have been trying to write a photo album by JavaFX, so I not only need to show pictures in a board but also I have to handle some selection events such as single selection by clicked and multiple selection using CTRL and click.
As shown in the image, I just used a "ListView" Class in JavaFX to implement it, which can handle selection event by using its existing methods.
However, when I want to achieve this interaction: drag mouse to draw a rectangle, pictures inside the rectangle are selected, and if click in blank, all the pictures selected will be set free(exactly these are operations in Windows Explorer), I have difficulty in tackling it. Before questioning this, I also read some examples about implementing multiple selection by mouse dragging in JavaFX, which only highlight the selected items. But except that, I still want to know which items are being selected(in this case, I want to know which images are selected) so that I can do copy, delete or something else.
That is to say, I indeed want to display and select my pictures like Windows Explorer does, is there any method to achieve this in JavaFX?
Thanks for your helping in advance!