Java Reference
In-Depth Information
topPanel.setCellHorizontalAlignment(userPanel,
HasHorizontalAlignment.ALIGN_RIGHT);
// set up a horizontal panel to hold the date picker
HorizontalPanel leftNav = new HorizontalPanel();
leftNav.setSpacing(5);
leftNav.add(new Label("Week Start Date"));
DateBox dateBox = new DateBox();
dateBox.setWidth("100px");
dateBox.setFormat(new
DateBox.DefaultFormat(DateTimeFormat.getFormat("M/d/yyyy")));
leftNav.add(dateBox);
// set up a horizontal panel to hold the Add and Save buttons
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setSpacing(5);
Button addRowButton = new Button("Add Row");
Button saveButton = new Button("Save");
buttonPanel.add(addRowButton);
buttonPanel.add(saveButton);
// set up another horizontal panel to dock all the buttons to
the right
final HorizontalPanel rightNav = new HorizontalPanel();
rightNav.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
rightNav.setWidth("100%");
rightNav.add(buttonPanel);
// add all of the navigation panels to the dock panel
navPanel.setWidth("1000px");
navPanel.add(leftNav, DockPanel.WEST);
navPanel.add(rightNav, DockPanel.EAST);
// set up a horizontal panel to hold the grand total
totalPanel.setSize("1000px","50px");
totalPanel.add(new Label("Total:"), 900, 25);
totalPanel.add(totalLabel, 950, 25);
115
Search WWH ::




Custom Search