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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:49:53+00:00 2026-06-09T17:49:53+00:00

Goodevening everyone, I stumbled on a rather strange problem today and I have no

  • 0

Goodevening everyone,

I stumbled on a rather strange problem today and I have no clue what I’m doing wrong. It’s about binding table columns with a PropertyValueFactory. I created the table view and table columns in FXML and set the appropriate fx:id’s with Scene Builder.

Now the problem is that some columns are showing the expected data and other columns are just empty. I add the items to the table view with following code when a user presses a button:

ObservableList<User> olUsers = DA_User.getUsers();
tbl_MC_Manage_Users.getItems().addAll(olUsers);

I know for sure that the user objects in olUsers contain all the data needed (tested it with a for loop and System.out.println)

I get a result like this: (<text> representing the column headers)

<disabled>   <username>    <title>    <lastname>    <firstname>   <address>   <zip>    <city>
false        (empty)       Mr.        (empty)       (empty)       address1    (empty)  city1
false        (empty)       Miss       (empty)       (empty)       address2    (empty)  city2

So for some reason colums username, lastname, firstname, zip are not showing any data…

Some parts of the controller:

//declaration (these are the fx:id's connected to my table colums)
@FXML private TableView<User> tbl_MC_Manage_Users;
@FXML private TableColumn<User,Boolean> tc_MC_Manage_Disabled;
@FXML private TableColumn<User,String> tc_MC_Manage_Username;
@FXML private TableColumn<User,String> tc_MC_Manage_Title;
@FXML private TableColumn<User,String> tc_MC_Manage_Lastname;
@FXML private TableColumn<User,String> tc_MC_Manage_Firstname;
@FXML private TableColumn<User,String> tc_MC_Manage_Address;
@FXML private TableColumn<User,String> tc_MC_Manage_ZipCode;
@FXML private TableColumn<User,String> tc_MC_Manage_City;

@Override
public void initialize(URL url, ResourceBundle rb) {
...
//setting the binding on the table columns at initialize();
    tc_MC_Manage_Disabled.setCellValueFactory(new PropertyValueFactory<User, Boolean>("disabled"));
    tc_MC_Manage_Username.setCellValueFactory(new PropertyValueFactory<User, String>("username"));
    tc_MC_Manage_Title.setCellValueFactory(new PropertyValueFactory<User, String>("title")); 
    tc_MC_Manage_Firstname.setCellValueFactory(new PropertyValueFactory<User, String>("firstname"));
    tc_MC_Manage_Lastname.setCellValueFactory(new PropertyValueFactory<User, String>("lastname"));  
    tc_MC_Manage_Address.setCellValueFactory(new PropertyValueFactory<User, String>("address"));
    tc_MC_Manage_ZipCode.setCellValueFactory(new PropertyValueFactory<User, String>("zipcode")); 
    tc_MC_Manage_City.setCellValueFactory(new PropertyValueFactory<User, String>("city"));
...
}      

Here are some parts of the User class

private SimpleBooleanProperty disabled = new SimpleBooleanProperty();
private SimpleStringProperty username = new SimpleStringProperty("");
private SimpleStringProperty title = new SimpleStringProperty("");
private SimpleStringProperty lastname = new SimpleStringProperty("");
private SimpleStringProperty firstname = new SimpleStringProperty("");
//... (same for the others)

//getters
public boolean isDisabled() { return disabled.get(); }
public String getTitle() { return title.get(); }
public String getUsername() { return username.get(); }
public String getLastName() { return lastname.get(); }
public String getFirstName() { return firstname.get(); }
//... (same for the others)

//setters
public void setDisabled(boolean value) { disabled.set(value); }
public void setUsername(String value) { username.set(value); }
public void setTitle(String value) { title.set(value); }
public void setLastName(String value) { lastname.set(value); }
public void setFirstName(String value) { firstname.set(value); }  
//... (same for the others)

Sorry for the loads of code, but I really don’t see why only a few columns are getting their data.. I hope someone can point me in the right direction 🙂

Thanks in advance!

  • 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-09T17:49:55+00:00Added an answer on June 9, 2026 at 5:49 pm

    If your setter is named getFirstName then property is firstName with capital “N”. Try next:

    tc_MC_Manage_Disabled.setCellValueFactory(new PropertyValueFactory<User, Boolean>("disabled"));
    tc_MC_Manage_Username.setCellValueFactory(new PropertyValueFactory<User, String>("userName"));
    tc_MC_Manage_Title.setCellValueFactory(new PropertyValueFactory<User, String>("title")); 
    tc_MC_Manage_Firstname.setCellValueFactory(new PropertyValueFactory<User, String>("firstName"));
    tc_MC_Manage_Lastname.setCellValueFactory(new PropertyValueFactory<User, String>("lastName"));  
    tc_MC_Manage_Address.setCellValueFactory(new PropertyValueFactory<User, String>("address"));
    tc_MC_Manage_ZipCode.setCellValueFactory(new PropertyValueFactory<User, String>("zipCode")); 
    tc_MC_Manage_City.setCellValueFactory(new PropertyValueFactory<User, String>("city"));
    

    Also I would advise you to add property methods to User class:

    public StringProperty titleProperty() { return title; }; // etc
    

    it will allow your table to reflect data changes. See 2nd part of Binding JavaFX 2 TableView elements

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

Sidebar

Related Questions

Goodevening how can have a JTextArea like in netbeans (see the pic) (source: hostingpics.net
Good evening, I have one table, with a timestamp column, then I have a
Good evening everyone. I am currently using MVC 3 and I have a viewmodel
Good evening fellow stackers, I have a mutex and threaded related question about //
Good Evening, The problem is that i have both xcode 3.2 and xcode 4
Good evening, people! I'm trying to solve a rather simple problem, but.. well, it
Good evening everyone, before explaining my problem, I should give you some explanation on
Good evening everyone! I am working on learning some java and I have made
Good evening everyone! I am having a bit of a problem and need some
Good evening everyone, I have a quick question on a homework assignment my class

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.