• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add rows and columns in TableView

 
Alejandro Hernandez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I'm new using JavaFX, and tried to create an GUI where the user can create a table with columns and rows, I read the oracle examples but all it is based on Person class and I don't know how to do it.

Please help me

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alejandro,
Welcome to the Ranch!

In the Oracle tutorial that you mentioned, the code for the Person class is also given. You can simply copy that code and create the class and use them.

You need to let us know which part is not clear to you.
 
Alejandro Hernandez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replay
Ranganathan Kaliyur Mannar

In that example the class Person has data and the table with specific columns. I want to that the user could create the table in menu where can introduce the number of columns and rows and after add different data in each column.

Regards
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. I haven't done that in JavaFX, but, should be possible. The TableView has a simple getColumns().add() method with which the columns are added. I don't see any reason why this cannot be done dynamically. What have you tried so far?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic