Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/08/2010, 06:07
sapales
 
Fecha de Ingreso: abril-2009
Mensajes: 121
Antigüedad: 15 años
Puntos: 4
Error programando en Swing

Hola:

Intento que al pulsar un botón me salga una ventana con un texto y el editor (Eclipse) me dice que existe un error en la línea JOptionPane():

private JButton getBtnSeleccionar() {
if (btnSeleccionar == null) {
btnSeleccionar = new JButton();
btnSeleccionar.setBounds(new Rectangle(345, 50, 122, 24));
btnSeleccionar.setText("Seleccionar...");
btnSeleccionar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
//System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
JOptionPane.showMessageDialog(this, "Eggs are not supposed to be green.");
}
});
}

¿Podéis ayudarme? El error es: The method ShowMessageDialog() in the type JOptionPane is not applicable for the arguments (new ActionListener(){}, String)

Gracias.