473,654 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ActionListener

Hi,

I have a small program to test the ActionListener, but it gives errors.
Here's part of the code:

class ButtonListener implements ActionListener {

public void actionPerformed (ActionEvent e) {

....

Error:
ActionListener cannot be resolved or is not a valid superinterface
ActionEvent cannot be resolved (or is not a valid type) for the argument e
of the method actionPerformed

What am I missing?

Thanks!

Patrick

Jul 17 '05 #1
1 5971
nos
import java.awt.event. *;
"Patrick Vanhoof" <ho*******@hotm ail.com> wrote in message
news:3f******** *************** @reader3.news.s kynet.be...
Hi,

I have a small program to test the ActionListener, but it gives errors.
Here's part of the code:

class ButtonListener implements ActionListener {

public void actionPerformed (ActionEvent e) {

...

Error:
ActionListener cannot be resolved or is not a valid superinterface
ActionEvent cannot be resolved (or is not a valid type) for the argument e
of the method actionPerformed

What am I missing?

Thanks!

Patrick

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2378
by: Hal Vaughan | last post by:
I have a "wizard" type program with a series of panels that are placed in a JPanel. When the "Next >" button is pressed, I put in a new panel (in other words, the ActionListener for "Next >" selects the proper panel from a CardLayout). Some of these panels, when selected, perform actions immediately. When that happens, the panel is not displayed until the action is complete. I've tried invalidating the layout and repainting, but it...
0
1796
by: linux newbie | last post by:
is there any java expert could tell me what the problem below and explain the code to me, your explanation is greatly appreciated :) static Class class$java$awt$event$ActionListener; static Class _mthclass$(String x$0) { try
1
3103
by: cnixuser | last post by:
Hello, I am currently attempting to implement a simple actionlistener for a button in a JFrame that was created via "drag and drop" with the Netbeans 5.0 IDE, the code that I am using to implement the actionlistener should work, and is taken from other functional examples ;however, for some reason the compiler kicks out the following error :/home/vontux/cis435lab1/src/UserInterface.java:103: <identifier> expected btn_roll.addActionListener(...
1
3912
by: Phil Latio | last post by:
Quite a while back I used Java Swing (for Uni project) which allowed the developer to a create form and on the "Submit" button I recall adding something called an ActionListener. I was thinking of trying to do the something similar in PHP but a bit puzzled on how I would achieve it. My thoughts are to have a class for a Textbox, class for a SubmitButton and a class called ActionListener which is invoked (is that the correct term??) when...
3
2421
by: shailajaanand | last post by:
can we add Actionlistener to textarea?
3
2786
by: stmfc | last post by:
KeyListener listens keyboard strokes, MouseListener listens mouse events, etc. My question is about ActionListener. what kind of events does ActionListener listen? its name does not give much information, or does it listen all possible events? can you give an example?
1
2258
by: carlos123 | last post by:
if (bathroom.isSelected()){ bathroom is a jcheckbox, why doesnt that work.
4
2867
Stubert
by: Stubert | last post by:
Hi there just a quick question, if I have multiple JMenuItems do I need to create an inner class ActionListener for each and every JMenuItem I create? Or is there a more efficient way of doing it? I know I could just use event.getSource and check it all in one big ActionListener, but I've been informed that this is bad pracitce and should be done using inner classes. Just wondering if there were any other ways of achieving this? Thanks,...
4
1992
by: Kid Programmer | last post by:
Hello guys. How do you create an ActionListener. I am confused on how to do it. Here is my code: /** * Written By: Edward Sanger * Coded in: Java * IDE Used: IntelliJ IDEA * Program Name: Calculator * Program Description: This program will create a GUI window with 4 buttons for 4 mathematical operators and 2 text * fields for the numbers to add, subtract, multiply, and divide.
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8494
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.