Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying data from Javafx Table

 
Bon Gun
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am new to javafx, I created a code similar to this tutorial: http://docs.oracle.com/javafx/2/ui_controls/table-view.htm

Question: How to display the data from TableView?

Example: I want to display the cell value from row1-column1 to row3-column1.

System.out.println(table-column1-row1);
System.out.println(table-column1-row2);
System.out.prinlnt(table-column1-row3);

What would be the codes? Please help me.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bon,
Welcome to the Ranch!

If I understand it correctly, the sample works and the data gets displayed for you in the table. Your question is now, how to get the data from the table and print it. Let me know if my understanding is right.
 
Bon Gun
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, thats right! I apologize for the long reply.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. There is a method getItems() in the TableView class which simply returns back the List<> of your objects. The first item in the list corresponds to the first row and so on.
Once you get the row object, you can call methods on that to get the individual values.
 
Bon Gun
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir... I appreciate it!
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, you're welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic