I can't run my java program

Hi there,

I have typed a program to show some buttons but whe I run this program it not showing nothing, here is the code:

package botonesetiquetasoyente;

import javax.swing.*;

import java.awt.event.*;

/**

*

* @author MIS_ES

*/

publicclass BotonesEtiquetasOyenteextends JFrame{

private JFrame frame;

private JLabel etiquetas;

private JButton botonUno;

private JButton botonDos;

private JPanel panel;

/**

* Creates a new instance of BotonesEtiquetasOyente

*/

public BotonesEtiquetasOyente(){

etiquetas =new JLabel("No se ha pulsado ningun boton");

botonUno =new JButton("Boton uno");

botonDos =new JButton("Boton dos");

panel =new JPanel();

panel.add(etiquetas);

panel.add(botonUno);

panel.add(botonDos);

OyenteAccion oyenteBoton =new OyenteAccion();

botonUno.addActionListener(oyenteBoton);

botonDos.addActionListener(oyenteBoton);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setTitle("Ventana con interaccion");

pack();

setVisible(true);

}

/**

* @param args the command line arguments

*/

publicstaticvoid main(String[] args){

BotonesEtiquetasOyente ventana=new BotonesEtiquetasOyente();

}

class OyenteAccionimplements ActionListener{

publicvoid actionPerformed (ActionEvent evento){

JButton boton =(JButton) evento.getSource();

etiquetas.setText("Boton pulsado: " + boton.getText());

}

}

}

Message was edited by:

RIMA33

[2989 byte] By [RIMA33a] at [2007-11-26 21:35:31]
# 1
you haven't added the panel to your JFrames contentPane
georgemca at 2007-7-10 3:16:03 > top of Java-index,Java Essentials,New To Java...
# 2
hey, thankshow can I add them?
RIMA33a at 2007-7-10 3:16:03 > top of Java-index,Java Essentials,New To Java...
# 3
getContentPane().add(panel);
georgemca at 2007-7-10 3:16:03 > top of Java-index,Java Essentials,New To Java...
# 4
thaks, it is working know
RIMA33a at 2007-7-10 3:16:03 > top of Java-index,Java Essentials,New To Java...
# 5
> thaks, > > it is working knowI know :-)
georgemca at 2007-7-10 3:16:03 > top of Java-index,Java Essentials,New To Java...