• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Start Applet not initialized

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created an applet and it is not working. When i try to run it in appletviewer it says Start Applet not initialized. Following is my code:

/*
<HTML>
<HEAD>
</HEAD>
<BODY>
<div >
<APPLET CODE="FormAction.class" WIDTH="800" HEIGHT="500">
</APPLET>
</div>
</BODY>
</HTML>
*/


import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class FormAction extends Applet implements ActionListener{
TextField text1;
TextField text2;
TextField text3;
Button button1;

public void init(){
setLayout(new FlowLayout());
button1 = new Button("Submit");
text1 = new TextField();
text2 = new TextField();
text2 = new TextField();

add(text1);
add(text2);
add(text3);
add(button1);

button1.addActionListener(this);
}

public void actionPerformed(ActionEvent evt){
if(evt.getSource() == button1){
text3.setText(text1.getText() + " " + text2.getText());
}
}
}

Can anyone please help me pointing out where am I wrong.
Thank You
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.
Can you copy paste what you see on your java console after running the applet?

Also please check your private messages for an important administrative matter
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
text3 is null.
reply
    Bookmark Topic Watch Topic
  • New Topic