Solved

Error Message: Cannot find symbol class ActionListner

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
github account with ecipse 1 47
custom annotations 9 38
servlet requestdispatcher include and forward differences 1 30
ForLoop Example 3 48
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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

786 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