Absolute Panel

This is an example of absolute panel. Advantage of absolute panel is that you can adjust the element position just by giving the position from left and top.

Reference:

Example demo:

Example Code:

function doGet(){

  var app = UiApp.createApplication();

  var absPanel = app.createAbsolutePanel().setWidth('200').setHeight('300');

 

  var ta = app.createTextArea();

  var tb = app.createTextBox();

  var anchor = app.createAnchor('This is Anchor',

                              'https://sites.google.com/site/appsscripttutorial');

  var label = app.createLabel('This is label');

  var lb = app.createListBox().addItem('Item1').addItem('Item2');

 

  absPanel.add(ta, 0, 0);//position is from left and top in pixels.

  absPanel.add(tb, 25, 70);

  absPanel.add(anchor,100,90);

  absPanel.add(label, 10, 20);

  absPanel.add(lb, 50, 100);

 

  app.add(absPanel);

  return app;

}