Scroll Prevention

Scroll Prevention


// Create a sub-window of a fixed width
//Window subWindow = new Window("Scrolling Sub");
Window subWindow = new Window("Scrolling Sub");
subWindow.setModal(true);
subWindow.setWidth("300px");
subWindow.setHeight("300px");
        
// Put some large content in it - scroll bars should
// now appear
GridLayout g = new GridLayout(10,10);
g.setWidth("400px");
g.setHeight("400px");
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);
        
// Prevent scrolling
subWindow.setScrollable(false);
// subWindow.setResizable(false);
        
// Add it to the main window of the application
mainWindow.addWindow(subWindow);