Scroll Bars

Scroll Bars


// Create a sub-window of a fixed width
Window subWindow = new Window("Scrolling Sub");
subWindow.setModal(true);
subWindow.setWidth("300px");
subWindow.setHeight("300px");
        
// Put some large content in it
GridLayout g = new GridLayout(10,10);
g.setWidth("500px");
g.setHeight("500px");
for (int i=0; i<g.getRows()*g.getColumns(); i++)
    g.addComponent(new Label("" + (i+1)));
        
// Set as root layout of the sub-window
subWindow.setContent(g);
        
// Add it to the main window of the application
mainWindow.addWindow(subWindow);