Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

javafx search feature mysql

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all I apologize for my grammar as english is not my first language,  also my first time posting and ask question even though im new to the site.

Right now im having a problem and im desperate to seek for help.

What im trying to do is build a search bar..


Say i have a Table

+--------------------------------------- ------------------------------
|  colID         | colTitle                          | colKeywords              |
+----------------+----------------------- -+-------------------------
| 1               |  Jumanji                        | comedy adventure     |
| 2               |  Moana                          | adventure animation  |
| 3               |  Shawshank Redemption | drama tearjerker       |
| 4               |  Avengers                      | action                       |
+--------------------------------------------------------------------

           +-----------------------------+    +------------+    
Search: | adventure and action movies   | button GO|
           +-----------------------------+    +------------+

What I want to do is if i type "adventure and action movies" in the textfield, and after I hit the button go, the result in the tableview should be:

Jumanji
Moana
Avengers



So far this is my code in the controller. It seems to work because if i search for "adventure", in the table view 2 cells can be highlighted
the problem is, no text appears.

also  i search random words it wont display anything on the table, which is good.

My code right now.

 
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to set a cellValueFactory
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you have 2 tableviews?

It would look something like this:

 
Daniel Demesmaecker
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you really should seperate your connection and query from your controllerclass. I would make a seperate class to create the connection and a dao to execute the querry
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!