简体   繁体   中英

GWT ScrollPanel with Horizontal SimplePanel

I'm trying to implement a scrollPanel within a Horizontal Panel.
I read this post GWT Horizontal panel with horizontal scrolling

The answer seems great, however I'm wondering if ravi wrapped his simple panel with a scroll Panel or vice versa.

Basically I wanted to know how the panels were nested within each other?

A scroll panel is nothing special - it's just a DIV element with some CSS set on it. That's what the answer to the other question means, as a SimplePanel is simply a Widget that appears as a DIV.

So what the other answer did was create a scrolling widget by:

  • Creating a SimplePanel as the content container
  • Set some CSS with the overflow-x attribute to the SimplePanel
  • Setting the content will now have a horizontal scroll bar (due to the CSS attribute).

If you prefer a more direct way of doing this check out UiBinder . Using it you can combine widgets/CSS/HTML elements in a form closer to how the browser renders your UI. So for example you can create a DIV with the required CSS to achive a scrolling container.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM