Reputation: 1389
I have a VericalPanel
. If I add an element to it, it will be added under the element, now how can I place an Element over it?
VerticapPanel vpanel = new VerticalPanel()
Upvotes: 0
Views: 1045
Reputation: 69440
Try the insert
method:
Here the description of the method regarding the documentation
protected void insert(Widget child, Element container, int beforeIndex, boolean domInsert)
Insert a new child Widget into this Panel at a specified index, attaching its Element to the specified container Element. The child Element will either be attached to the container at the same index, or simply appended to the container, depending on the value of domInsert.
Parameters:
child
- the child Widget to be added
container
- the Element within which child will be contained
beforeIndex
- the index before which child will be inserted
domInsert
- iftrue
, insert child into container atbeforeIndex
; otherwise append child to the end of container.
Upvotes: 2
Reputation: 36894
You can use
VerticalPanel#insert(Widget w, int beforeIndex)
instead of
VerticalPanel#add(Widget w)
This will insert the widget at the given position.
Upvotes: 3