Solved

Error Message: Cannot find symbol class ActionListner

Posted on 2006-10-29
5
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb example issues 3 92
Facing this issue for maven proxy setting 2 45
sql import cannot be resolved jsp 3 117
Java Restore security prompts not working 10 271
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
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…
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…

710 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