Does
this example for for you? Both scroll bars work at least in my Chrome.
Remember to set undefined size for both the Embedded and the Panel’s root layout, and a defined (fixed or relative) size for the Panel. There shouldn’t be differences between browsers if you don’t do that, though.
Notice that you can get scroll bars for an image also with CSS, without having to put it in a Panel. It relies a bit more on the implementation, so it’s not normally recommended.
Thanks, the sample you suggested helped me a lot.
As my panel has a HorizontalLayout and I want Horizontal only scroll-bar it is needed to specify Height,
my code now is:
panel = new Panel(new HorizontalLayout());
panel.setWidth(100, Sizeable.UNITS_PERCENTAGE);// Full page
panel.setHeight(125, Sizeable.UNITS_PIXELS); // Images Height plus Horizontal scroll-bar
panel.getContent().setSizeUndefined();
I had a similar problem with a scroll bar not appearing in Chrome (on Linux) - thanks to these posts I realised I need to set the height of the containing panel for the horizontal scroll bar to appear. (The height needs to be absolute, a percentage does not work)
As Pietro reported, this was not required for Firefox, so there is clearly a browser difference.