Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public RadioButtons() {
- //Aquí salta el error, en las líneas de bajo
- radioCerdo.addItemListener(new escuchador_casilla());
- radioConejo.addItemListener(new escuchador_casilla());
- radioPajaro.addItemListener(new escuchador_casilla());
- radioGato.addItemListener(new escuchador_casilla());
- radioPerro.addItemListener(new escuchador_casilla());
- initComponents();
- }
- class escuchador_casilla implements ItemListener {
- public void itemStateChanged(ItemEvent evento){
- if(radioCerdo.isSelected()){
- ImageIcon icono = new ImageIcon("/img/pig-coloring-page.gif");
- Image imagen = icono.getImage();
- int ancho = imagen.getWidth(null);
- int alto = imagen.getHeight(null);
- Image nuevaImagen = imagen.getScaledInstance(ancho, alto, java.awt.Image.SCALE_SMOOTH);
- icono = new ImageIcon(nuevaImagen);
- lblImagen.setIcon(icono);
- }
- if(radioConejo.isSelected()){
- Font font = new Font("Serif", Font.BOLD,12);
- //textfield1.setFont(font);
- }
- if(radioPajaro.isSelected()){
- Font font = new Font("Arial", Font.ITALIC,12);
- //textfield1.setFont(font);
- }
- if(radioGato.isSelected()){
- Font font = new Font("Arial", Font.ITALIC + Font.BOLD,12);
- //textfield1.setFont(font);
- }
- if(radioPerro.isSelected()){
- Font font = new Font("Arial", Font.ITALIC + Font.BOLD,12);
- //textfield1.setFont(font);
- }
- }
- }
Add Comment
Please, Sign In to add comment