views:

78

answers:

1

hi, how can make the text of the radio box appear on the left side of the button instead of the right?

on left to right languages the standard is the text on radio button is on the right of the radio button, i need to write ui for a right to left language so the test should be placed on the left of the radio button.

any advice??

+1  A: 

Try using this class instead. I've not tested it thoroughly but it looks like it does what you want it to do.

class RightToLeftRadioButton extends RadioButton {

 public RightToLeftRadioButton(final String name) {
  super(name);
  InputElement inputElem = (InputElement)getElement().getFirstChildElement();
  inputElem.removeFromParent();
  getElement().appendChild(inputElem);
 }

 public RightToLeftRadioButton(final String name, final String label) {
  this(name);
  setText(label);
 }

 public RightToLeftRadioButton(final String name, final String label, final boolean asHTML) {
  this(name);
  if (asHTML) {
   setHTML(label);
  } else {
   setText(label);
  }
 }
}
Iker Jimenez