JavaFX sizes doubts -


if have window borderpane , size properties are:

  • min width: use_pref_size.
  • min height: use_pref_size.
  • pref width: 600.
  • pref height: 400.
  • max width: use_pref_size.
  • max height: use_pref_size.

why can resize window? haven't clear how works these properties (i read api , still don't understand).

the min/max/pref width , height of region used parent layout pane determine how size , position child nodes of pane. if put border pane in parent manages layout (i.e. subclass of pane), settings adhered to, if possible.

however, scene not layout pane , performs no layout. has 1 root node (a parent instance), , sizes root size of scene. in turn, scene sized window , takes on size of window minus space needed window border , decorations.

consequently, these settings on borderpane have no effect on resizability of window. turn off ability resize window, use window method setresizable(false). similarly, if want impose minimum or maximum sizes on window, use window's min/max width/height properties.


Comments