1
votes

The FloatingButton seems to be added only in Form.getContentPane() and cannot be added to a container Adding it to my form would make the button shield some components underneaths,

Any solution to this? I would like to have positioned inside the scrolling table in a BorderLayout.CENTER

not much options here:

fab.bindFabToContainer(current, Component.RIGHT, Component.CENTER);
    

enter image description here

1

1 Answers

0
votes
fab.bindFabToContainer(current, Component.RIGHT, Component.CENTER);

Doesn't add the fab to a container. It creates a new container and returns it so the right statement would be:

current = fab.bindFabToContainer(current, Component.RIGHT, Component.CENTER);
myForm.add(current);

Since the fab needs to float on top and we don't want to change your existing layout we create a new wrapper container with layered layout.

Notice that in the form/content page we can use the existing form layered layout (plus the content pane can't be replaced) so we detect that and use a special case with the layered pane.