Array de JRadioButton
Publicado por Rebeca (3 intervenciones) el 08/09/2007 20:18:59
Hola, tengo el siguiente codigo
Cuando lo ejecuto no aparece ningún JRadioButton en pantalla, ¿alguien sabe a qué se debe?¿Se puen hacer arrays de JRadio Button?
this._grupoOpciones= new ButtonGroup[1];
this._grupoOpciones[0]= new ButtonGroup();
{
_opciones[0]=new JRadioButton();
_opciones[0].setText(this._txTerminoUno.getText()+" es padre de "+this._txTerminoDos.getText());// new JRadioButton(this._txTerminoUno.getText()+" es padre de "+this._txTerminoDos.getText());
System.out.println("LO UE HAY ES "+_opciones[0].getText());
_opciones[0].setVisible(true);
numLetras= _opciones[0].getText().length();
_opciones[0].setBounds(14,posY,numLetras*this.PIXELPORLETRA,ALTURA);
posY=posY+ALTURA;
_grupoOpciones[0].add(_opciones[0]);
}
{
_opciones[1]= new JRadioButton(this._txTerminoDos.getText()+" es padre de "+this._txTerminoUno.getText());
_opciones[1].setVisible(true);
numLetras= _opciones[1].getText().length();
_opciones[1].setBounds(14,posY,numLetras*this.PIXELPORLETRA,ALTURA);
posY=posY+ALTURA;
_grupoOpciones[0].add(_opciones[1]);
Cuando lo ejecuto no aparece ningún JRadioButton en pantalla, ¿alguien sabe a qué se debe?¿Se puen hacer arrays de JRadio Button?
this._grupoOpciones= new ButtonGroup[1];
this._grupoOpciones[0]= new ButtonGroup();
{
_opciones[0]=new JRadioButton();
_opciones[0].setText(this._txTerminoUno.getText()+" es padre de "+this._txTerminoDos.getText());// new JRadioButton(this._txTerminoUno.getText()+" es padre de "+this._txTerminoDos.getText());
System.out.println("LO UE HAY ES "+_opciones[0].getText());
_opciones[0].setVisible(true);
numLetras= _opciones[0].getText().length();
_opciones[0].setBounds(14,posY,numLetras*this.PIXELPORLETRA,ALTURA);
posY=posY+ALTURA;
_grupoOpciones[0].add(_opciones[0]);
}
{
_opciones[1]= new JRadioButton(this._txTerminoDos.getText()+" es padre de "+this._txTerminoUno.getText());
_opciones[1].setVisible(true);
numLetras= _opciones[1].getText().length();
_opciones[1].setBounds(14,posY,numLetras*this.PIXELPORLETRA,ALTURA);
posY=posY+ALTURA;
_grupoOpciones[0].add(_opciones[1]);
Valora esta pregunta


0