Solved

Error Message: Cannot find symbol class ActionListner

Posted on 2006-10-29
5
175 Views
Last Modified: 2011-04-14
Dear experts:

Hi again!

I got an error message as (in the title), while compiling a simple Java code.  Part of the code aret are as the follows:

import javax.swing.JOptionPane;
import java.text.DecimalFormat;
import java.util.regex.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class CalcRate extends JApplet implements ActionListner
  {
   
   JLabel die1Label, die2Label, sumLabel, pointLabel;
   JTextField die1Field, die2Field, sumField, pointField;
   JButton rollButton;

.
.
.
.

 public void init ()
  {
     Container tiger = getContentPane ();
     tiger.setLayout ( new FlowLayout ()  );
     
     
     die1Label = new JLabel( "Die 1");
     tiger.add (die1Label);
     
     die1Field = new JTextField (10);
     die1Field.setEditable (false);
     tiger.add (die1Field);
     
     die1Label = new JLabel ( "Die 2");
     tiger.add (die1Label);
     
     die2Field = new JTextField (10);
     die2Field.setEditable (false);
     tiger.add (die2Field);
     
     sumLabel = new JLabel ( "Sum is ");
     tiger.add (sumLabel);
     
     sumField = new JTextField (10);
     sumField.setEditable  (false);
     tiger.add (sumField);
     
     pointLabel = new JLabel ( "Point is ");
     tiger.add (pointLabel);
     
     pointField = new JTextField (10);
     pointField.setEditable  (false);
     tiger.add (pointField);
     
     rollButton = new JButton ("Roll Dice");
     rollButton.addActionListner (this);
     tiger.add (rollButton);
     
   
   
  }
0
Comment
Question by:duta
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
matthew016 earned 500 total points
ID: 17830707
>> implements ActionListner

Wrong spelling

public class CalcRate extends JApplet implements ActionListener {
0
 
LVL 9

Expert Comment

by:matthew016
ID: 17830711
>> rollButton.addActionListner (this);

rollButton.addActionListener (this);
0
 

Author Comment

by:duta
ID: 17830854
Matthew, thanks a lot.

I will take time to try your tip, and come back to you.

Thanks a lot!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now