Guest User

Untitled

a guest
Oct 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. public RadioButtons() {
  2. //Aquí salta el error, en las líneas de bajo
  3. radioCerdo.addItemListener(new escuchador_casilla());
  4. radioConejo.addItemListener(new escuchador_casilla());
  5. radioPajaro.addItemListener(new escuchador_casilla());
  6. radioGato.addItemListener(new escuchador_casilla());
  7. radioPerro.addItemListener(new escuchador_casilla());
  8. initComponents();
  9.  
  10. }
  11.  
  12. class escuchador_casilla implements ItemListener {
  13. public void itemStateChanged(ItemEvent evento){
  14. if(radioCerdo.isSelected()){
  15.  
  16. ImageIcon icono = new ImageIcon("/img/pig-coloring-page.gif");
  17. Image imagen = icono.getImage();
  18. int ancho = imagen.getWidth(null);
  19. int alto = imagen.getHeight(null);
  20. Image nuevaImagen = imagen.getScaledInstance(ancho, alto, java.awt.Image.SCALE_SMOOTH);
  21. icono = new ImageIcon(nuevaImagen);
  22.  
  23.  
  24. lblImagen.setIcon(icono);
  25. }
  26. if(radioConejo.isSelected()){
  27. Font font = new Font("Serif", Font.BOLD,12);
  28. //textfield1.setFont(font);
  29. }
  30. if(radioPajaro.isSelected()){
  31. Font font = new Font("Arial", Font.ITALIC,12);
  32. //textfield1.setFont(font);
  33. }
  34. if(radioGato.isSelected()){
  35. Font font = new Font("Arial", Font.ITALIC + Font.BOLD,12);
  36. //textfield1.setFont(font);
  37. }
  38. if(radioPerro.isSelected()){
  39. Font font = new Font("Arial", Font.ITALIC + Font.BOLD,12);
  40. //textfield1.setFont(font);
  41. }
  42. }
  43. }
Add Comment
Please, Sign In to add comment