Generation

generate functionTue, 16 May 2023

desarrollar un semáforo y sincronizarlo con los colores correspondientes, simulando el cruce de un vehículo cuando el semáforo este en color verde deberá ser grafico.

package ejercicio_clase_10; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; /** * * @author alumno */ public class Ejercicio_Clase_10 extends JFrame implements ActionListener{ JPanel panel; JButton boton1, boton2,boton3; JLabel etiqueta1,etiqueta2,etiqueta3; public Ejercicio_Clase_10(){ this.setSize(600,400); this.setLocationRelativeTo(null); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setTitle("Semáforo"); componentes(); this.setVisible(

Questions about programming?Chat with your personal AI assistant