EJERCICIO 19.
import java.awt.*;
import java.awt.event.*;
public class ScrollPanelOption extends Frame {
public ScrollPanelOption(String titulo, int x, int y){
super("opciones de scroll panel");
setSize(x,y);
setVisible(true);
setLayout(new FlowLayout());
}
public void AgregarPanelScroll(){
ScrollPane panel=new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
Panel otroPanel=new Panel();
otroPanel.setLayout(new GridLayout(7,4));
CheckboxGroup opcionGrupo;
opcionGrupo= new CheckboxGroup();
otroPanel.add(new Checkbox("java 1"));
otroPanel.add(new Checkbox("c++ 1", opcionGrupo, true));
otroPanel.add(new Checkbox("php 1"));
panel.add(otroPanel);
add(panel);
validate();
}
public static void main (String[] args){
ScrollPanelOption miVentana=new ScrollPanelOption("Ventana scroll", 200,250);
miVentana.AgregarPanelScroll();
miVentana.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}