Les traigo un nuevo programa "Uso de CheckBox, ComboBox y Radio Button en Java NetBeans!!!" ¿Cómo puedes ayudarme? COMENTA, COMPARTE Y SUSCRIBETE A MI CANAL PARA MÁS CONTENIDO GRATIS!!!! pagina de facebook: facebook.com/solojava/
The append() method is available in the StringBuilder class, but not in the JTextArea class. To concatenate strings in JTextArea, you can use the setText() method. Here is a modified version of your Semestre() method that uses setText() to concatenate the semester number to the text area: java public void Semestre(){ // Check which radio button is selected if(Radio1.isSelected()){ // Set the text of the text area to "Semestre: N°1" TxtArea1.setText(" Semestre: " + "N°1"); } else if(Radio2.isSelected()){ // Set the text of the text area to "Semestre: N°2" TxtArea1.setText(" Semestre: " + "N°2"); } else if(Radio3.isSelected()){ // Set the text of the text area to "Semestre: N°3" TxtArea1.setText(" Semestre: " + "N°3"); } else if(Radio4.isSelected()){ // Set the text of the text area to "Semestre: N°4" TxtArea1.setText(" Semestre: " + "N°4"); } else if(Radio5.isSelected()){ // Set the text of the text area to "Semestre: N°5" TxtArea1.setText(" Semestre: " + "N°5"); } else if(Radio6.isSelected()){ // Set the text of the text area to "Semestre: N°6" TxtArea1.setText(" Semestre: " + "N°6"); } } This modified method should work as expected.
Les traigo un nuevo programa "Uso de CheckBox, ComboBox y Radio Button en Java NetBeans!!!"
¿Cómo puedes ayudarme?
COMENTA, COMPARTE Y SUSCRIBETE A MI CANAL PARA MÁS CONTENIDO GRATIS!!!!
pagina de facebook:
facebook.com/solojava/
Si donde esta ese condigo me podrías decir por favor
Muchas gracias por su tutorial !!
Muchas gracias Profe! genial su tutorial!!
hola, disculpa por alguna razon la funcion append no existe y no me funciona, no me deja concatenar
The append() method is available in the StringBuilder class, but not in the JTextArea class. To concatenate strings in JTextArea, you can use the setText() method.
Here is a modified version of your Semestre() method that uses setText() to concatenate the semester number to the text area:
java
public void Semestre(){
// Check which radio button is selected
if(Radio1.isSelected()){
// Set the text of the text area to "Semestre: N°1"
TxtArea1.setText("
Semestre: " + "N°1");
} else if(Radio2.isSelected()){
// Set the text of the text area to "Semestre: N°2"
TxtArea1.setText("
Semestre: " + "N°2");
} else if(Radio3.isSelected()){
// Set the text of the text area to "Semestre: N°3"
TxtArea1.setText("
Semestre: " + "N°3");
} else if(Radio4.isSelected()){
// Set the text of the text area to "Semestre: N°4"
TxtArea1.setText("
Semestre: " + "N°4");
} else if(Radio5.isSelected()){
// Set the text of the text area to "Semestre: N°5"
TxtArea1.setText("
Semestre: " + "N°5");
} else if(Radio6.isSelected()){
// Set the text of the text area to "Semestre: N°6"
TxtArea1.setText("
Semestre: " + "N°6");
}
}
This modified method should work as expected.
Da error
Amigo cuantos años tienes?
^v^
te sigo