Radio Buttons

for example i have this:

Checkbox cb;

CheckboxGroup cbg;

cb =new Checkbox("Hello", cbg,true);

in this case the Hello will be right of the radio button, so how can i make it to the top of the radio button?

THanks

[342 byte] By [bail_wa] at [2007-11-27 11:45:00]
# 1

I'm not sure if this can be done.

You could make a default Checkbox, one that has no label. Then create a separate label and place that above the Checkbox.

floundera at 2007-7-29 17:59:17 > top of Java-index,Java Essentials,New To Java...
# 2

what method do i use to determine which checkbox is selected?

Edit: since i cant use getSelectedCheckbox().getLabel() what should i use?

Message was edited by:

bail_w

Message was edited by:

bail_w

bail_wa at 2007-7-29 17:59:17 > top of Java-index,Java Essentials,New To Java...
# 3

> what method do i use to determine which checkbox is selected?

[EDIT] Sorry, that was Swing...

CheckboxGroup.getSelectedCheckbox();

~

yawmarka at 2007-7-29 17:59:17 > top of Java-index,Java Essentials,New To Java...
# 4

well the thing is i created four empty checkbox then place four different label on top. so now i dont know how to determine which one is selected

edit: nvm, i did some tricks by using empty space in the string lol.

cb = new Checkbox("", cbg, true);

Message was edited by:

bail_w

Message was edited by:

bail_w

Message was edited by:

bail_w

bail_wa at 2007-7-29 17:59:17 > top of Java-index,Java Essentials,New To Java...
# 5

You may have to use an if statement and call the getState method on each button.

floundera at 2007-7-29 17:59:17 > top of Java-index,Java Essentials,New To Java...