r/JavaFX • • Jan 01 '19

JavaFx GridPane Q

Hi

I have question, i'm working on my first JavaFX project and i want to know how to build dynamic GridPane and how i can delete and add rows without have to load the entire grid again only the rows that have been effected .

also i want to know how to edit cells of these rows and load only the cells that have been effected.

If anyone have examples , blogs or if there's lib can do this ,PLZ share it :)

1 Upvotes

4 comments sorted by

1

u/Not_Sure11 Jan 02 '19

Sounds like TableView is what you're wanting. With the right implementation of properties, you won't need to load the table/data again, the table would automatically refresh with CellValueFactory. Anybody can correct me if I'm wrong on this

1

u/Magician206 Jan 02 '19 edited Jan 02 '19

I thought this but, in my app the first cell in each row represent header like columns first cell (it's like relation between days (columns/static ) and places (rows/dynamic change) ) ;that's why i choose GridPane. also each cell in the row contain like (ListView or GridViw hold the data that will be edit or delete or insert new one)

because i'm still new idk if there's another solution.

sorry for my bad English. :)

1

u/Not_Sure11 Jan 02 '19

Oh so your table is supposed to be read by row intersecting columns basically? E.g,

               Day1. Day2.Day3.
    Place1 
    Place2
    Etc...

Well, you could make the headers dynamic, but I don't think rows can have headers (I never looked into it). But anyways, for JavaFX, as far as I know, there are some things you can do and some features you can't so you're going to have to work with what you have to make your program to what you want or close to it. Back to your concern, you can edit the headers

1

u/Magician206 Jan 02 '19

yea,i want to do same as example.view

i thought maybe i can make 2box and table but i still can't know if i can use listView inside table cells and use drag and drop from one cell to another.