This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
hi all I am pretty new to java. I set up a ButtonGroup which contains 3 RadioButtons. When I pressed "Load" button the form will retrieve the data from a database and display the relevant information of the specific record.Then I made a new button called "new record" to clear all the information 'DISPLAYED' on the form. The actionPerformed of "new record" button is:
all the information within the textfields was cleared since I pressed the button, however, the selected RadioButton is still selected which I thought there should be no radiobutton selected after pressing the button.
Can anyone help me out here? Really appreciate!
cheers
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
in a buttonGroup, once a selection has been made, one must always be selected
workarounds 1) add a dummy button to the group, but do not display it. instead of setting the current selection to false, you set the dummy to be selected 2) remove the selected button from the button group, set its selection to false, then re-add it to the button group
Jan Tang
Greenhorn
Joined: Sep 23, 2003
Posts: 9
posted
0
Originally posted by Michael Dunn: in a buttonGroup, once a selection has been made, one must always be selected
workarounds 1) add a dummy button to the group, but do not display it. instead of setting the current selection to false, you set the dummy to be selected 2) remove the selected button from the button group, set its selection to false, then re-add it to the button group
OK,now I get it. I've tried to make a dummy button before but I just thought there could be some better ways to solve this problem. It seems that I'd better add that button again now.Thanks for your help buddy.