Following the instructions in this documentation about Animations and Transitions, it is noted that animation done on the Form
level requires taking the contentpane as the actual Container
. So instead of
form.animateLayout(1000);
one has to do
form.getContentPane().animateLayout(1000);
While the documentation points out this exception, wouldnt it be easier and more user-friendly to update the animateLayout()
function to check whether the intended Component to do the animation for is a Form itself and if so, automatically getting its content pane?
This would remove this exception handling from the user side and make it more intuitive.