Eventos en Java
HOla necesito hacer una aplicacion con menús, alguien me podría enseñar un ejemplo de como al hacer clic sobre un Item del Menú puedo abrir una ventana? lo estoy haciendo con el manejador handleEvent y no me funciona, con ActionListener no encuentro documentacion decente, gracias por adelantado
aqui te pongo el codigo:
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
Public class Manejador_Boton_Abrir_Ventana implements ActionListener{
JFrame ventana;
public Manejador_Boton_Abrir_Ventana(JFrame ventana){
this.ventana=ventana
}
public void actionPerformed(ActionEvent e){
ventana.show()
}
}
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
Public class Manejador_Boton_Abrir_Ventana implements ActionListener{
JFrame ventana;
public Manejador_Boton_Abrir_Ventana(JFrame ventana){
this.ventana=ventana
}
public void actionPerformed(ActionEvent e){
ventana.show()
}
}