Usage of a unchecked checkbox with a textarea | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Usage of a unchecked checkbox with a textarea

I had struggling with a little problem. I want to make a void method that checks which checkbox between my 4 ones are selected or even more especifically enabled,then When I check or uncheck any of them , that it be able to erase the checked value that places my textarea object when I deselect or disable the respective checkbox, and in the contrary case it can be placed at the text area. I have created a method like this: public void checkentries(){ If (checkb1.isSelected){ txtarea1.append(String.valueOf(check1.getText()); } else txtarea1.setText("") } And this continues checking the four checkbox at this same method like this even'til the last checkbox. But the problem is when I Disable anyone, this set a void string at the textarea and then it removes the other text of the enabled ones that the text area got before. Plz don't care about some symbols as semicolons, maybe I could forget them here,but in java they're ok. Thanks in advance.

17th Jun 2019, 9:59 PM
RVehicleOfficial
RVehicleOfficial - avatar
2 Answers
+ 1
Thnx
20th Jul 2019, 11:10 PM
RVehicleOfficial
RVehicleOfficial - avatar