java - how to implement multi imageView select holding control button in javaFX -


in javafx application, having imageviews in tilepane , want implement multi select functionality in android images . tried adding border style imageview on click event didnt work. there way achieve this.

you can embed image in javafx button, , set onaction methods of button:

imagebutton.setonaction(new eventhandler<actionevent>() {     @override public void handle(actionevent e) {         system.out.println("changing color of button's border :");         imagebutton.setstyle("-fx-border-color:blue;");         system.out.println("for further reference, can save button or image in treeset:");         treeset.add(imagebutton);     } });  

if simple click enough select image, can define onaction method of button above. if need long click (push , hold in android style) change selection status of image, can find more information on 'push , hold' click here : how achieve javafx mouse event "push , hold"? .


Comments