In this example, I have made some textboxes with different styling.
Hope you like it. You can see how a style Attribute can be applied without writing much code.
'backgroundColor' : '#99FFCC',
'border': '1px solid #008000',
'border': '2px dashed #D1C7AC',
'border': '3px double #CCCCCC',
'border': '1px solid #3366FF',
'borderLeft': '4px solid #3366FF'
//Funtion to apply the style on an element
function applyCSS(element,style){
element.setStyleAttribute(key, style[key]);
var app = UiApp.createApplication();
var panel = app.createVerticalPanel();
var grid = app.createGrid(5,2);
var label1 = app.createLabel('Style 1: ').setWidth('50');
var textBox1 = app.createTextBox();
var label2 = app.createLabel('Style 2: ');
var textBox2 = app.createTextBox();
var label3 = app.createLabel('Style 3: ');
var textBox3 = app.createTextBox();
var label4 = app.createLabel('Style 4: ');
var textBox4 = app.createTextBox();
var label5 = app.createLabel('Style 5: ');
var textBox5 = app.createTextBox();
grid.setWidget(0, 0, label1)
.setWidget(0, 1, textBox1)
.setWidget(1, 1, textBox2)
.setWidget(2, 1, textBox3)
.setWidget(3, 1, textBox4)
.setWidget(4, 1, textBox5);