Logic. Consider this:
public void actionPerformed(ActionEvent ae)
{
String name, age;
String location;
String gender, conduct, gift;
//rbMale
if(ae.getSource() == rbMale)
{
gender = "Male";
}
//rbFemale
if(ae.getSource() == rbFemale)
{
gender = "Female";
}
...
//bView
if(ae.getSource() == bView)
{
...
name = tfName.getText();
age = tfAge.getText();
taView.append("Name:"+(" ")+name);
taView.append("Age:"+(" ")+age);
taView.append("Sex:"+(" ")+gender);
...
}
}
The only way that the String variable "gender" can/will be assigned a value is if
ae.getSource() == either "rbMale" or "rbFemale". In any other case, most notably here: "bView", the local variable "gender" has no value assigned to it. The compiler needs to see a value for "gender" before you try to use it.
Solution: give it a value (initialize it) at declaration, eg:
String gender = "unknown";