Advertisement
Mudreco

Clase Listener_Visibilidad

Jun 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package ejercicioinscripciones;
  7.  
  8. import java.awt.event.ActionEvent;
  9. import java.awt.event.ActionListener;
  10. import javax.swing.JFrame;
  11.  
  12. /**
  13.  *
  14.  * @author Mudreco
  15.  */
  16. public class Listener_Visibilidad implements ActionListener {
  17.  
  18.     JFrame frameInterno;
  19.  
  20.     Listener_Visibilidad(JFrame frame) {
  21.         frameInterno = new JFrame();
  22.         frameInterno = frame;
  23.     }
  24.  
  25.     public void cambiarVisibilidad() {
  26.         if (frameInterno.isVisible()) {
  27.             frameInterno.setVisible(false);
  28.         } else {
  29.             frameInterno.setVisible(true);
  30.         }
  31.     }
  32.  
  33.     public void actionPerformed(ActionEvent e) {
  34.         cambiarVisibilidad();
  35.     }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement