Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8939985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:56:19+00:00 2026-06-15T10:56:19+00:00

import java.awt.*; import java.applet.*; public class Appletdemo extends Applet { TextField text1,text2; public void

  • 0
import java.awt.*;
import java.applet.*;
public class Appletdemo extends Applet
{
TextField text1,text2;
public void init()
    {
    text1=new TextField(10);
    text2=new TextField(10);
    add(text1);
    add(text2);
    text1.setText("");
    text2.setText("");
    }
    public void paint(Graphics g)
    {
    int z=0,x=0,y=0;
    String s1,s2,s;
    g.drawString("input no in each textbox",10,50);
    try
    {
    s1=text1.getText();
    x=Integer.parseInt(s1);
    s2=text2.getText();
    y=Integer.parseInt(s2);
    }
    catch(Exception e)
    {
    }
    z=x+y;
    s=String.valueOf(z);
    g.drawString("The sum is",10,80);
    g.drawString(s,100,80);
    }
    public boolean action(Event event,Object object)
    {
    repaint();
    return true;
    }
    }

This is the code that i am trying to understand what is the need of

    public boolean action(Event event,Object object)
    {
    repaint();
    return true;
    }

Why we are using it in our program.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:56:20+00:00Added an answer on June 15, 2026 at 10:56 am

    This is an old construct used to handle Action events from Java 1.0 prior to the use of ActionListeners.

    In Java 1.0 there was just one class of events, namely java.awt.Event. Every event was generated by a component. One major problem with the model was that an event could only be handled by the component which generated it or by one of the containers that contained the original component.

    In Java 1.1 style event handling (using Event Listeners) known as the Delegation Event Model brought significant improvements. Here an event is sent only to objects that are listening for the event giving greater efficiency in event processing.

    See: Java 1.0 Event Model

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

package homework1; import java.applet.Applet; import java.awt.Graphics; public class Homework1A extends Applet { public void
this is the code: import java.awt.*; import java.applet.*; public class anim1 extends Applet{ public
import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.applet.*; public class Stuff extends Applet implements
import java.awt.*; import java.applet.*; public class IdrawApplet extends Applet { Button myButton; Panel pPanel;
import java.awt.Color; import java.awt.Graphics; import javax.swing.JFrame; public class Sheet extends JFrame{ private String[] line
Here I found this code: import java.awt.*; import javax.swing.*; public class FunWithPanels extends JFrame
I have this test app: import java.applet.*; import java.awt.*; import java.net.URL; public class Test
this is the code: import java.awt.*; import java.awt.event.*; import java.applet.*; import java.util.Vector; public class
Java applet code package M257Applet import java.applet.*; import javax.swing.*; import java.awt.*; public class HellowApplet
Looking at some code, learing about threads : import java.applet.*; import java.awt.*; public class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.