Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX 2 Creating a Custom Pane

I have seen several custom JavaFX control tutorials around, but no tutorials on how to create a custom pane layout. I ask because I am trying to create a flowing two-sided (think form-like (name,value) pairs) layout pane with titles. I have previously done the control in WPF, and am "migrating" it to JavaFX. Are there any places I could look for learning how to make a custom layout pane aside from the OpenJDK sources?

To clarify: I an looking for how to create a custom pane layout manager and not custom controls

like image 429
byteit101 Avatar asked Oct 15 '13 21:10

byteit101


1 Answers

I'm not sure myself, but I think you should override layoutChildren method from the Parent class. This method is called each time the JavaFX performs layout pass.

You may use controlsfx project code as sample. Just clone it and search for layoutChildren string in the project. impl.org.controlsfx.spreadsheet.GridRowSkin.java looks like a good example.

like image 127
ayvango Avatar answered Nov 11 '22 17:11

ayvango