Solved

Error Message: Cannot find symbol class ActionListner

Posted on 2006-10-29
5
173 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 47
return in catch statement 1 40
Problem to start Neon 20 52
Groovy:unable to resolve class error 2 30
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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

706 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

19 Experts available now in Live!

Get 1:1 Help Now