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 8986425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:32:48+00:00 2026-06-15T21:32:48+00:00

In my JavaFX TableView I have one TableColumn on which I have set Cell

  • 0

In my JavaFX TableView I have one TableColumn on which I have set Cell Factory to render ProgressBar and for other TableColumns I have set Cell Factory to show ToolTip. Like the image below. Second Column is showing Progress Bar and other 3 Columns are render to show Tool tip, that has simple string values to show.

enter image description here

I was getting issue in which the TableView was not displaying/showing updated values in the table i.e UI is not validating/refreshing/painting the TableView elements. If I clicked on ColumnHeader to sort any column then only I can see the TableView updating. Manually sort the table column to refresh the table content is not making sense so I have searched and found solution to show/hide the Table Columns for updating the Table View.

To resolved the issue I have written a code below to solve the TableView Updating/Refreshing issue but due to this code now ToolTip are not getting visible.

Code to Update Table View after each specific interval

 class TableProgressBarUpdator implements Runnable {

        TableView table;

        public TableProgressBarUpdator(TableView fxtable) {
            table = fxtable;

        }

        public void start() {
            new Thread(this).start();
        }

        public void run() {

            while (keepUpdating) {
                try {
                    updateProgressbar();
                    Thread.sleep(1000);
                } catch (Exception e) {
                    LogHandler.doErrorLogging("Error while updating tables cell", e);
                }
            }
            LogHandler.doDebugLogging("Table process repainting is completed.");
        }

        private void updateProgressbar() throws Exception {
            Platform.runLater(new Runnable() {
                @Override
                public void run() {
                    ((TableColumn) table.getColumns().get(0)).setVisible(false);
                    ((TableColumn) table.getColumns().get(0)).setVisible(true);
                }
            });


        }
    }

Start Updating Table View

public void startUpdatingTableProgress() {
    keepUpdating = true;
    TableProgressBarUpdator tpu = new TableProgressBarUpdator(table);
    tpu.start();
}

Stop Updating Table View

public void stopUpdatingTableProgress() {
        keepUpdating = false;
    }

Adding more code that is showing render classes to show Progress bar and display Tool Tip.

Code to show the Progress Bar Table View.

public static class ProgressBarTableCell<S, T> extends TableCell<S, T> {

        private final ProgressBar progressBar;
        private ObservableValue<T> ov;

        public ProgressBarTableCell() {
            this.progressBar = new ProgressBar();
            progressBar.setPrefHeight(23);
            setAlignment(Pos.CENTER);
        }

        @Override
        public void updateItem(T item, boolean empty) {
            super.updateItem(item, empty);
            if (item == null) {
                setGraphic(null);
                setText(null);
            } else {
                if (item.toString().equalsIgnoreCase("Processing")) {
                    Platform.runLater(new Runnable() {
                        @Override
                        public void run() {

                            if (getGraphic() == null) {
                                setGraphic(progressBar);
                                progressBar.setProgress(-1);
                            } else {
                                ProgressBar objpProgressBar = (ProgressBar) getGraphic();
                                objpProgressBar.setProgress(-1);
                            }
                            setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
                        }
                    });
                } else {
                    Platform.runLater(new Runnable() {
                        @Override
                        public void run() {
                            if (getGraphic() == null) {
                                setGraphic(progressBar);
                                progressBar.setProgress(0);
                            } else {
                                ProgressBar objpProgressBar = (ProgressBar) getGraphic();
                                objpProgressBar.setProgress(0);
                            }
                            setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
                        }
                    });
                }
            }
        }
    } 

Code to Show the Tool Tip

public class ToolTip extends TableCell {

        @Override
        protected void updateItem(Object object, boolean selected) {
            if (object == null) {
                setGraphic(null);
                setText(null);
            }else{
                setText(object.toString());
                setTooltip(new Tooltip(object.toString()));
            }
        }
    }

Issue –

If I comment-out these two lines from TableProgressBarUpdator Class then I am able to see Tool Tip for each cell values in 1st, 3rd and 4th column but now Table View contents are not updating/refreshing and when I UN-comment these lines I am unable to see the Tool Tip.

((TableColumn) table.getColumns().get(0)).setVisible(false);
((TableColumn) table.getColumns().get(0)).setVisible(true);

In all due to these two lines my Tool Tip Render is not working and If I remove these two lines then Table View Content are not Refreshing/Updating.

  • 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-15T21:32:50+00:00Added an answer on June 15, 2026 at 9:32 pm

    You don’t need to update TableView manually. may be there are problem in your class associated with that TableView's column.

    You have to create class as given below :

    public static class Test{
    
    private StringProperty name;
    
    private Test() {
       name = new SimpleStringProperty();
    }
    
    public Test(String name) {
        this.name = new SimpleStringProperty(name);
    }
    
    public void setName(String name) {
        this.name.set(name);
    }
    
    public String getName() {
        return name.get();
    }
    
    public StringProperty nameProperty() {
        return name;
    }
    

    }

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

Sidebar

Related Questions

Does JavaFX 2.0 supports printing? I have a text area from which I take
When using a TableView in JavaFX 2, there seems to be magically one column
How does one easily apply custom (reusable) cellFactories to javafx.scene.control.TableCell; or javafx.scene.control.TableView; ?
I have JavaFx application with TableView and MySQL database. I have create entity model(Products)
In JavaFX 2 I have a TableView beeing populated by reading an Excel file.
I have a JavaFX 2.0 application, which consists of two FXML files, and two
I have just explore javaFX. I am now programming modul based application by netBeans
Set up your JavaFX project in NetBeans IDE as follows. From the File menu,
I have made JavaFx menu and its submenus; they work fine in a stand-alone
I have a JavaFX app with a some code like this... public class MainListener

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.