I have again a problem regarding on using database to a program in netbeans. This is my problem, I have a button group which contains male and female button. When you clicked the 'Submit' button, the selected button will write the text of it to mySQL data base. So the problem is, I don't know the reverse of it.
I will make my question as clear as possible. I want to retrieve a text from database and select that retrieved text in one of the buttons of button group.
For example, I retrieved 'male' from the data base, so I want a code to select 'male' radio button. Thank you.
EDIT:
So I got it now. I am looking for some method that will instantly select a button from a text retrieved in data base. I used the crude process, little messy but it worked nice!
String temp = (jTable1.getModel().getValueAt(row, 11).toString());
if ("Male".equals(temp)) {
maleRButton.setSelected(true);
}
else if ("Female".equals(temp)) {
femaleRButton.setSelected(true);
}