Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8586669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:21:57+00:00 2026-06-11T22:21:57+00:00

Given a TableView, i need to detect the doubleclick on a cell. tableView.setOnMouseClicked(new EventHandler<MouseEvent>()

  • 0

Given a TableView, i need to detect the doubleclick on a cell.

tableView.setOnMouseClicked(new EventHandler<MouseEvent>()
{
    @Override
    public void handle(MouseEvent event)
    {
        if(event.getClickCount()>1)
        {
            System.out.println("double clicked!");
        }
    }
});

How to determine the cell on which the mouse has been clicked?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:21:58+00:00Added an answer on June 11, 2026 at 10:21 pm

    Code example.
    Run the “Example 12-11: Alternative Solution Of Cell Editing” of official tableview tutorial.
    Replace the followings:

    table.setEditable(false);
    Callback<TableColumn, TableCell> cellFactory =
            new Callback<TableColumn, TableCell>() {
                public TableCell call(TableColumn p) {
                    TableCell cell = new TableCell<Person, String>() {
                        @Override
                        public void updateItem(String item, boolean empty) {
                            super.updateItem(item, empty);
                            setText(empty ? null : getString());
                            setGraphic(null);
                        }
    
                        private String getString() {
                            return getItem() == null ? "" : getItem().toString();
                        }
                    };
    
                    cell.addEventFilter(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
                        @Override
                        public void handle(MouseEvent event) {
                            if (event.getClickCount() > 1) {
                                System.out.println("double clicked!");
                                TableCell c = (TableCell) event.getSource();
                                System.out.println("Cell text: " + c.getText());
                            }
                        }
                    });
                    return cell;
                }
            };
    

    No need to EditingCell since your cells are uneditable. Cell factory is used for cell rendering. So one can put any node/control other than default Labeled using cell’s setGraphics() method. IMO you cannot access the default cell directly so you should define your own cell factory to be able to put event filter on cell.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a tableview, I need to prevent a cell from being created by a
I need to return cell in tableView:cellForRowAtIndexPath: only when some condition is true,for example:
Given a certain date, I want to set the value of a cell with
I need to create expandable-cell form nib. It looks fine if dimenssions of cell
resize a image in table view cell... i am new programmer by this code
I have a tableview where i need to show around 10,000 rows (data stored
I have this method: - (void)reloadMessages:(NSNotification *)notification { NSLog(@RECIEVED NEW MESSAGES TO MessagesRootViewController); //
I am having an array to display in an tableview .i need a button
I'm trying to create a cell on a tableview which doesn't go all the
I need to test whether various types of database objects exist in a given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.