I am having problem to set label at right corner in ToolBar.
Hear is piece of code please check it.
public class CustomGrid extends ContentPanel {
private final Grid<ContentItem> grid ;
public CustomGrid() {
setHeaderVisible(false);
setBodyBorder(false);
setBorders(false);
setHeaderVisible(false);
setCollapsible(true);
setLayout(new FitLayout());
/* Code...... */
LabelToolItem item = new LabelToolItem();
item.setLabel("0 Rows Selected..");
ToolBar toolbar = new ToolBar();
toolbar.setAlignment(HorizontalAlignment.RIGHT);
toolbar.add(item);
setTopComponent(toolbar);
add(grid);
}
}
in above code toolbar displays label in center.
if i give toolbar.setAlignment(HorizontalAlignment.LEFT); than it display at left corner but, while i give toolbar.setAlignment(HorizontalAlignment.RIGHT); it displays at center. what should i do?, i missing something?
please help me.
I had a similar problem trying to right-align a Button in a HorizontalPanel. The solution was to pack the button into a cell and set the align_right on the cell.
Another solution might be calling
addFill()on the Toolbar before adding the elements that should go right.