?Hello. I'm from Tokyo.
I'm developer of Java, recently I'm working with Server Side Java
Technology.
I read your source and my opinion is SuperClass should be
java.awt.Frame.
This code will help:
// import java.applet.Applet;
import java.awt.event.ActionListener;
import java.awt.*;
import java.awt.Window;
import java.awt.event.*;
public class clicker extends Frame implements ActionListener{
TextField text1;
Button button1;
public clicker (){
super( "This is Java Application" );
System.out.println( "---Test1---" );
text1 =new TextField(20);
button1 = new Button ("Click Here!");
button1.addActionListener(this);
add( text1 );
add ( button1 );
setLayout( new FlowLayout() );
pack();
setVisible( true );
System.out.println( "---Test2---" );
}
public static void main( String[] args ){
System.out.println( "---Test main Start!---" );
clicker Clicker = new clicker();
Clicker.show();
// Clicker.setVisible( true );
System.out.println( "---Test main End!---" );
}
public void actionPerformed(ActionEvent event){
String msg = new String ("Welcome to Java!");
System.out.println( "( event.getSource() == button1) : " + (
event.getSource() == button1) );
if( event.getSource() == button1){
text1.setText(msg);
}
}
}
Please think about one step futher what you wanted to try.
_/_/_/_/_/_/_/_/_/_/_/_/_/_/
[EMAIL PROTECTED]
_/-Osamu Hashimoto-_/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/
----- Original Message -----
From: "Joseph Kimo Kreis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 1:04 AM
Subject: I am a beginner
> Hello I got my java program to work if I type in java it works. If
I type
> in javac it work. But when I made a simple program like for a
button on an
> applet it says:
>
> import java.applet.Applet;
> import java.awt.*;
> import java.awt.event.*;
>
> public class clicker extends Applet implements ActionListener{
>
> TextField text1;
> Button button1;
>
> public void init(){
> text1 =new TextField(20);
> add(text1);
> button1 = new Button ("Click Here!");
> add (button1);
> button1.addActionListner(this);
> }
>
> public void actionPerformed(ActionEvent event){
> String msg = new String ("Welcome to Java");
> if( event.getSource() == button1){
> text1.setText(msg);
> }
> }
> }
>
>
> There error says:
>
> clicker.java:15: cannot resolve symbol
> symbol : method addActionListner (clicker)
> location: class java.awt.Button
> butto1.addActionListner(this)
> ^
>
> I Don't understand what that means I got this example out of a book
"Java 2
> Complete." Does this book suck?
> If you know how to solve my problem can you help. And can you point
me in
> the right direction for book that I need to get.
>
> Thank you
> ~
> ~~
> ~~~
>
**********************************************************************
*********
>
> Joseph Kimo Kreis
> Web Developer for MS&E Department
> Terman Engineering Center
> Stanford University
> Stanford, CA 94305-4026
> mailto:[EMAIL PROTECTED]
>
>
**********************************************************************
**********
>
>
======================================================================
=====
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets