+1  A: 

I've used dragController.setConstrainWidgetToBoundaryPanel(true), and I think dragController.setBehaviorConstrainedToBoundaryPanel(true) does the same thing. For more information, check out the javadoc for your version.

DLH
That keeps the sliders in the bar after they are dropped. I would like the slider buttons to stay within the bar while they are dragged. Can e.g. the mouse X position be set?
lbp
Sorry, I used the surrounding panel as boundary panel. Your solution works now. Thanks!
lbp
+1  A: 

The method you're looking for is defined in AbstractDragController with this signature; void setBehaviorConstrainedToBoundaryPanel(boolean constrainedToBoundaryPanel);

The boundary panel (often passed in in the first parameter to the drag controller constructor) in this case should be an AbsolutePanel which wraps the slider.

It may also be helpful to visualize the absolute panel if things are not working as expected: absolutePanel.getElement().getStyle().setProperty("border", "1px dashed red");