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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:25:20+00:00 2026-06-17T12:25:20+00:00

Much like this question , I am trying to update a TableView in JavaFX

  • 0

Much like this question, I am trying to update a TableView in JavaFX. I have adopted the solution using DataFX.

My code :

File file = new File(path);
if(file.exists() && file.canRead()) {
    DataSourceReader dsr1 = new FileSource(file);
    String[] columnsArray = {"firstName", "lastName"}; 
    CSVDataSource ds1 = new CSVDataSource(dsr1, columnsArray);
    System.out.println("CSV : " + ds1.getData().size());  // outputs 0

    //Below is commented out since I don't have data : source of the error
    //tblAthleteList.setItems(ds1.getData());
    //tblAthleteList.getColumns().addAll(ds1.getColumns());
}

Here is a view of my test .csv file :

firstName, lastName
first, last
test, tester

I am using JavaFX 2, DataFX 1.0 and building in e(fx)clipse

Edit

Have changed the code a bit to use the FileSource(File f) constructor to see if this changes anything. Turns out I am trying to print something from the CSVDataSource and I always get a NullPointerException. Therefore assumming that the CSVDataSource doesn’t get any data. From examples I can find this is being done correctly. I can read the file using a simple BufferedReader and a loop.

Edit 2

Edited the question… I am now specifying that the error is in the fact that no data gets pulled into the CSVDataSource from the .csv file. The line ds1.getData().size() returns 0. Posted a very simple .csv file I am using. EOL consists of CR + LF and edited in Notepad++ (no Excel superfluous characters).

  • 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-17T12:25:21+00:00Added an answer on June 17, 2026 at 12:25 pm

    make sure column names in columnsArray are exactly equal to column names in CSV file (case sensitive).

    i got the similar exception when i put my column name as year in code but in my csv file its Year.

    Update According to Edit in Question :

    remove space between , and lastName in file or put " lastName" as column name in code 🙂

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

Sidebar

Related Questions

I have an ajax loader much like this one: $('#loadingDiv') .hide() // hide it
I would like a hint or much better a solution for this: I do
UPDATE (5 July 2013): I've learned much since I originally asked this question. In
UPDATE: (recap, fiddle and bounty) This question hasn't been getting too much attention, so
This might seem like a n00b question, but I am trying to break some
Until recently, I posted Python code (whitespace matters) to blogspot.com using something like this:
I'm thinking about building a login system for Ruby on Rails, much like this
I want to do something like this, but I haven't had much success so
This feels like it should be pretty simple, but not much seems to be
I'd like to add custom controls to the mediaPlayer control view much as this

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.