• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I run the project I do not see any table view thing coming up.
 
Martin Vashko
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

  •  
    I don't even know how to spell CIA. But this tiny ad does:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic