WebTextField trailing = new WebTextField ( "Trailing", 10 );
trailing.setMargin ( 0, 0, 0, 2 );
trailing.setTrailingComponent ( new WebImage ( loadIcon ( "search.png" ) ) );
// Password field with image as leading component
WebPasswordField leading2 = new WebPasswordField ( "Leading", 10 );
leading2.setLeadingComponent ( new WebImage ( loadIcon ( "key.png" ) ) );
// Password field with image as trailing component
WebPasswordField trailing2 = new WebPasswordField ( "Trailing", 10 );
trailing2.setTrailingComponent ( new WebImage ( loadIcon ( "key.png" ) ) );
// Text field with image as leading and trailing components
WebTextField both = new WebTextField ( "Both", 10 );
both.setHorizontalAlignment ( WebTextField.CENTER );
both.setMargin ( 0, 2, 0, 2 );