Sponsored Content
Top Forums Programming Java Applet: addTextListener method undefined??? Post 302632361 by gabam on Monday 30th of April 2012 12:50:05 AM
Old 04-30-2012
Java Applet: addTextListener method undefined???

Hi friends,
I hope everyone is doing fine and well. I am wrtting a small applet in java which listens to changes in text fields. Please have a look at my code, then we will talk about it.

Code:
import java.awt.*;
import java.applet.*;
import java.awt.event.TextEvent;
import javax.swing.*;
import java.awt.event.TextListener;
import java.awt.TextComponent;
 
 
public class Event_Handling extends Applet implements TextListener
{
String s;
 
public void init()
{
addTextListener( this ); // Compiler says it(addTextListener) is not defined
addTextListener( this );
TextField tf1 = new TextField();
add( tf1 );
}
public void paint( Graphics g )
{
g.drawString(msg, 50, 50);
}
public void textValueChanged( TextEvent te )
{
msg = "Text value changed";
repaint();
}
}

Java compiler doesn't recognize addTextListener, what must be the problem. It does recognize addMouseListener, but why not addTextListener???

Looking forward to your replies.
Thanks

Moderator's Comments:
Mod Comment Code tags for code, please.

Last edited by Corona688; 04-30-2012 at 12:51 PM..
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Linux task applet

Hi there, My task applet in Linux has crashed and I can't find how to activate it again!!! I am running Redhat Linux 7.1, and I am using the Gnome GUI. Would anyone have any ideas? Ta (2 Replies)
Discussion started by: ghoti
2 Replies

2. Programming

Not able to execute the method based on OS in JAVA

Hi, In my application,I want to find out the OS name and based on OS I want to do some specific operations.So I write some code based on it in JAVA but I am able to get the OS name but Not able to use the method specific to OS.I write a simple code to check it and found that it is not going to... (1 Reply)
Discussion started by: smartgupta
1 Replies

3. Shell Programming and Scripting

Calling Java Method from UNIX using shell script

Hi All, I need to call a java method from a shell script. I know we can use the command java ClassName to call the main method in it. But I need to call another method that is there in the class and pass an email to it. Can I use java ClassName.MethodName(email) Any help will be... (4 Replies)
Discussion started by: RahulK
4 Replies

4. Solaris

svc:/network/physical:default: Method "/lib/svc/method/net-physical" failed with exit status 96. [ n

After a memory upgrade all network interfaces are misconfigued. How do i resolve this issue. Below are some out puts.thanks. ifconfig: plumb: SIOCLIFADDIF: eg000g0:2: no such interface # ifconfig eg1000g0:2 plumb ifconfig: plumb: SIOCLIFADDIF: eg1000g0:2: no such interface # ifconfig... (2 Replies)
Discussion started by: andersonedouard
2 Replies

5. Programming

modifying 2 or more values using method in Java

i wanna make modification in two or more identifiers,using a method in JAVA , but the only way to do this is by returning a value ,then also only one variable value can be modified .. one way 2 do do this is by use of array and passing its name in method ,, please suggest a different way of doing... (2 Replies)
Discussion started by: upvan111
2 Replies

6. Emergency UNIX and Linux Support

Perl error: Can't call method "value" on an undefined value

Hi, I am running a perl script to automate a process and I keep running into a error can't find the "value" Can't call method "value" on an undefined value at process_file.pl line 44. file is CVS cell is ifdfdxrfmp.ksh Here is the script I have also attached it as well: ... (2 Replies)
Discussion started by: vpundit
2 Replies
rmiregistry(1)						      General Commands Manual						    rmiregistry(1)

NAME
rmiregistry - Java remote object registry SYNOPSIS
rmiregistry [ port ] DESCRIPTION
The rmiregistry command creates and starts a remote object registry on the specified port on the current host. If port number is omitted, the registry is started on port 1099. The rmiregistry command produces no output and is typically run in the background. For example: example% rmiregistry & A remote object registry is a bootstrap naming service that is used by RMI servers on a host to bind remote objects to names. Clients can then look up remote objects and make remote method invocations. The registry is typically used to locate the first remote object on which an application needs to invoke methods. That object in turn pro- vides application-specific support for finding other objects. The methods of the java.rmi.registry.LocateRegistry class are used to get a registry operating on a particular host or host and port. The URL-based methods of the java.rmi.Naming class operate on a registry and can be used to look up a remote object, bind a simple (string) name to a remote object, rebind a new name to a remote object (overriding the old binding), unbind a remote object, and list the URLs bound in the registry. OPTIONS
The following option is supported: -Joption Used in conjunction with any java option, this option passes option (no spaces between -J and option) on to the java inter- preter. SEE ALSO
See (or search java.sun.com) for the following: java.rmi.Naming @ http://java.sun.com/j2se/1.5/docs/api/java/rmi/Naming.html java.rmi.registry.LocateRegistry @ http://java.sun.com/j2se/1.5/docs/api/java/rmi/registry/LocateRegistry.html 23 Apr 2001 rmiregistry(1)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy