Codigo parking
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
/**
*
* @author Elizzaaaaa
*/public class Parking extends javax.swing.JFrame {
int coches;
JButton btnEntrada;
JButton btnSalida;
JButton btnReiniciar;
JLabel etiNum1;
JLabel etiCoches;/** Creates new form Parking */
public Parking() {
initComponents();
coches=0;
CreacionParking();
}
public void CreacionParking (){this.setTitle ("Parking");
this.setSize(500,400);
this.setLocation(200,200);
btnEntrada = new JButton();
btnEntrada.setText ("Entro un Coche");btnEntrada.setBounds (20,20,150,30);
this.getContentPane().add(btnEntrada);
btnSalida = new JButton();
btnSalida.setText ("Salio un Coche");
btnSalida.setBounds (20,80,150,30);this.getContentPane().add(btnSalida);
btnReiniciar = new JButton();
btnReiniciar.setText ("Reiniciar");
btnReiniciar.setBounds (20,140,150,30);this.getContentPane().add(btnReiniciar);
etiNum1 = new JLabel ();
etiNum1.setText ("Coches en el Parking");
etiNum1.setBounds (20,300,150,30);
this.getContentPane().add(etiNum1);
etiCoches = newJLabel ();
etiCoches.setText ("");
etiCoches.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
etiCoches.setBounds (200,300,150,30);this.getContentPane().add(etiCoches);
btnEntrada.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
btnEntradaActionPerformed(evt);}
});
btnSalida.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {...
Regístrate para leer el documento completo.