FIX Columns Number | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

FIX Columns Number

how can fix columns number in GridPane layout manager? is there any configurable property on "GridPane" to have the behaviour I look for?

31st May 2020, 3:24 PM
Miss. ShahHosseinian
Miss. ShahHosseinian - avatar
7 ответов
+ 1
About fixed colums: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/layout/GridPane.html If you look into the documentation you just add a node to a cell. For example a button: add(button, 0, 0) I would define an integer for rowIndex which can increase. int rowIndex = 0; .add(button, 0, rowIndex); rowIndex++; column is fixed, rows increase. Other methods you could use: .setRowIndex() and .setColumnIndex() About Layout: As I mentioned you can put every node in a gridPane cell. So you could add a VBox or HBox or whatever you want. And inside the layout you add the content (text or shapes...).
3rd Jun 2020, 7:31 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Sorry but I don't have access to your google drive account. But you can upload the picture in your feed and share the link here.
4th Jun 2020, 1:18 PM
Denise Roßberg
Denise Roßberg - avatar
0
Hello Miss. ShahHosseinian Can you share more information about your query? At the moment I am not sure what you want to do.
31st May 2020, 10:28 PM
Denise Roßberg
Denise Roßberg - avatar
0
Okay. I want to build a table with gridPane that each cell has own layout manager like HBox. so the issue is my table size should be Yx3. this means that my table should cover the screen with this details: 3 column and there's no limit for rows num. I don't know why nobody not understanding me. I am not okay with java fx bcz i started it just few days ago.finally tnx Denise Roßberg
3rd Jun 2020, 7:04 PM
Miss. ShahHosseinian
Miss. ShahHosseinian - avatar
0
Miss. ShahHosseinian Now it clear for me. It was more a language barrier. But I need to do some research because I'm not sure if every cell can have it's own layout manager.
3rd Jun 2020, 7:17 PM
Denise Roßberg
Denise Roßberg - avatar
0
Okay. tnx Denise Roßberg but I think should see you this: https://drive.google.com/file/d/154A-IuFBBLVu8_XoawwhXJ73-4F_oDHZ/view?usp=sharing I want this table fit width screen!
4th Jun 2020, 7:47 AM
Miss. ShahHosseinian
Miss. ShahHosseinian - avatar
0
I didn't consider this issue, yes u right
4th Jun 2020, 7:39 PM
Miss. ShahHosseinian
Miss. ShahHosseinian - avatar