Paul Clapham wrote:This line of code looks wrong to me:
The "getInt()" method is supposed to take the SQL parameter index as its parameter, so I'd expect to see a constant there, probably 3.
You didn't say whether you were getting an SQLException thrown -- did you get one? That's what I would expect if my guess was right. Otherwise, it would help to know what the evidence was for you thinking there was a problem.
John Damien Smith wrote:When you use a PropertyValue factory like this:
your corresponding java bean data class needs to follow Java camel case naming conventions for methods.
To see these conventions read:
Java naming conventions on Wikipedia.
For a more in depth explanation read:
Ok - so I'd tried something similar before. (I've been trying to find any and every example I could to try and figure this out).
That being said - I set this exactly the way you specified. However, I'm still getting a blank row for the part name.
Note that, when setting the property you don't create a new property in the setter, you just create a new property once when the bean is initialized (all properties can generally be declared final even though the value inside them changes, because the property holding the value never changes).
That was something I'd picked up following a Youtube tutorial on tableviews and scenebuilder by Jaret Wright.
Also, read the PropertyValueFactory documentation which outlines all of the rules which I explained above:
I'll be reading through this again to get a better understanding of this. Do you have any other suggestions on what to look for since I'm still getting a blank part name? Could it be the constructor for my part class? Note - the partName portion has changed multiple times as well through this process.
Knute Snortum wrote:This code injects an object reference tblMainParts into the code, so no, you don't have to (and you should not) create the object with new. The fx:id in SceneBuilder connects the FXML widget with the code's variable identifier. Make sense?