• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

populating a database data in gui(javafx+scenebuilder used)

 
Namrita Mohanty
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI, I new to JavaFX and was trying to read my database data into a Table view (GUI). Please help me!!!



*******************************
CONTROLLER CLASS:


*******************************

FXML:


*******************************

 
Namrita Mohanty
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If any one has a sample program to read a database please share as well. Would be of a great help n reference.
Thanks,
Namrita
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've added code tags to your original post to make the code more readable. Next time, you can do so yourselves using the Code button when composing your post.

What exact problems are you encountering? Without the details, we aren't able to help much (see TellTheDetails). There is one obvious bug in your code, though:This is a bad idea: if these exceptions get thrown, you catch them and do nothing. As a result, whatever is in the ll list at that time gets returned, probably just an empty list. You should throw an unchecked exception from the catch clause, and also make sure that the exception gets written somewhere where it can be read, so that you can investigate the issue.
 
Namrita Mohanty
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run the project I do not see any table view thing coming up.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not well versed in JavaFX, but I don't see a TableView class neither in your code, nor in your FXML file. So I guess there is no table in your code that could show up.

Have you tried to follow the JavaFX table tutorial?
 
John Damien Smith
Ranch Hand
Posts: 296
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are links to a sample for populating a JavaFX UI control (a ListView) with data retrieved from a database:
  • Single threaded solution
  • Multi-threaded task based solution


  • Another sample for TableView data based on a database:
  • Dynamic TableView Data From Database

  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic