This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JavaFX and the fly likes Displaying data from Javafx Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Displaying data from Javafx Table" Watch "Displaying data from Javafx Table" New topic
Author

Displaying data from Javafx Table

Bon Gun
Greenhorn

Joined: May 30, 2013
Posts: 8
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

Joined: Oct 16, 2003
Posts: 1076
    
  10

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.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Bon Gun
Greenhorn

Joined: May 30, 2013
Posts: 8
Yes, thats right! I apologize for the long reply.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

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

Joined: May 30, 2013
Posts: 8
Thank you sir... I appreciate it!
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

Sure, you're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying data from Javafx Table
 
Similar Threads
JTable and getValueAt()
Hibernate cache problem?
NullPointer Exception while using Apache POI
Passing Table values to action class
Displaying Table