Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javafx ListView

 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!!!

for show list of my database i write this code:



when open, show this:

Persone@42343
Persone@45234

why???

where is the error???
 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no "error", that's just the toString() representation of your Persone objects. I don't know JavaFX, but Swing uses toString() by default to display values; you can use renderers (ListCellRenderer, TableCellRenderer, TreeCellRenderer) to modify the way objects are displayed. I'm sure JavaFX has some similar mechanism. A quick search leads me to believe that Cell / ListCell is that mechanism. From the API of ListView:
Customizing ListView Visuals

The visuals of the ListView can be entirely customized by replacing the default cell factory. A cell factory is used to generate ListCell instances, which are used to represent an item in the ListView. See the Cell class documentation for a more complete description of how to write custom Cells.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic