fix javafx 2 layout compatiblity