Posts Tagged mouse

TableView data selection by mouse press

Well It has been quiet long time but I found it would be time for me to blog small post about making the table cell selection in JavaFX. Normally TableView has facility to select the cell or row by using Ctrl,Command (Shortcut Key) and Shift button. You can easily select the data using your keyboards. But when it comes for ease to user interaction using mouse is vital. So today we will go through how to create selection of data by mouse. Lets categorize them in two parts. Read the rest of this entry »

Tags: , , , ,

Dragging Image in Javafx

Hello today I would like to write a blog of how can we make the image draggable in a Stage.
Firstly you need to know more about MouseEvent, ImageView in JavaFx API.

Here we’ll be working around the dragX , dragY properties of MouseEvent class and x, y properties of ImageView. I’ve seen so many blogs but none of the blog had given me the smooth dragging feature in javafx. So here I’m going to start my codes for smooth dragging ability to ImageView .

After using this code you can see the mouse dragging is being binded with the ImageView ‘x’ and ‘y’ position. Futher more for saving the temporary x and y position of ImageView I’ve used mouseReleased() event.

Thanks for viewing blog.

Tags: , , , , , ,