
Botón de selección
Java
Publicado el 26 de Marzo del 2018 por Administrador (718 códigos)
4.764 visualizaciones desde el 26 de Marzo del 2018
Simple código que muestra como utilizar el botón de selección


import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class boton_de_seleccion
{
static JFrame ventana;
static CheckboxGroup boton_de_seleccion;
public void boton_de_seleccion()
{
ventana= new JFrame("boton_de_seleccion o Label") ;
boton_de_seleccion = new CheckboxGroup ();
ventana.add(new Checkbox ("Texto 1",boton_de_seleccion,false) );
ventana.add(new Checkbox ("Texto 2",boton_de_seleccion,false) );
ventana.add(new Checkbox ("Texto 3",boton_de_seleccion,false) );
ventana.add(new Checkbox ("Texto 4",boton_de_seleccion,false) );
ventana.reshape(550,200,200,200);
ventana.setLayout(new FlowLayout());
ventana.show();
}
public static void main (String [] args)
{
boton_de_seleccion x=new boton_de_seleccion();
x.boton_de_seleccion();
}
}
Comentarios sobre la versión: Versión 1 (0)
No hay comentarios