radio button and hiding group

let suppose i have login and sign up and there are 2 group g1 and g2 if i am using login then g1 will be visible and g2 will be invisible and vice versa

can anyone tell how can i do it please ?

public boolean validate()
{
boolean ret;

ret = super();

switch(LogDetails.selection())
{
case (0) :

{
LoginDetails.visible(true);
EveryDetails.visible(false);
}

case (1):
{

LoginDetails.visible(false);
EveryDetails.visible(true);
}

}
return ret;

}

i used this

And both of the control(Logindetails & Signupdetails) should be initially set as visible false.you can do this in deisgn.

it is not working

only one group is showing

can you tell me whether my coding is correct or not