Problème de compilation non résolu en JAVA

Fermé
nathalie2 - 6 juil. 2005 à 11:44
 nathalie2 - 6 juil. 2005 à 11:58
import javax.swing.*;
import java.awt.event.*;
import java.util.Date;
import java.text.DateFormat;
import javax.swing.JOptionPane;
class ListenerHeure implements java.awt.event.ActionListener
{
public void ActionPerformed(java.awt.event.ActionEvent ev)
{
String heure= DateFormat.getTimeInstance().format(new Date());
JOptionPane.showMessageDialog(null,"Il est " +heure);
}
}

J'ai ce message:

java.lang.Error: Problème de compilation non résolu :
La classe doit implémenter la méthode abstraite héritée ActionListener.actionPerformed(ActionEvent)

at ListenerHeure.actionPerformed(applic1.java:36)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
A voir également:

1 réponse

Timon1102 Messages postés 354 Date d'inscription jeudi 2 juin 2005 Statut Membre Dernière intervention 30 décembre 2010 109
6 juil. 2005 à 11:53
tu a mis action en majuscule, or il faut respecter la casse actionPerformed
0
Merci beaucoup.
0