void () { Rectangle bounds = getBounds(); myComponent.setBounds(0, 0, bounds.width, bounds.height); var toolbarSize = myFloatingToolbar.getPreferredSize(); myFloatingToolbar.setBounds( bounds.width - toolbarSize.width - RIGHT_OFFSET, TOP_OFFSET - (toolbarSize.height - ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE.height) / 2, toolbarSize.width, toolbarSize.height ); }