Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how can I know user double click on tableview items?

928280May 30 2012 — edited May 30 2012
tableview.setOnMouseClicked(new EventHandler<MouseEvent>() {
						@Override
						public void handle(MouseEvent arg0) {
							
									    if(arg0.getClickCount()==2)
                                                                            {
                                                                                  Object item = (Object)tv.getSelectionModel().getSelectedItem();
                                                                                //TODO
                                                                            }
                                                                           }});
I handle the double click event like above code ,for example,open file or something,I found it would be triggered if user double click the blank of the table view or columns of the table view, how can I know user double click on the right items? I only want it to be triggered when user click the items?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 27 2012
Added on May 30 2012
1 comment
124 views