beingtopper.jkp@gmail.com
+91-7529019575
Free Demo

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
AppletB.tech notesBCA NOTESInformation technologyJava ProgramsPrograms/Algorithm

Example of an applet program in java

Being Topper Admin 18/02/2014 0 Comments

Introduction to An Applet program in Java

Before Jumping Straight to Writing an Applet program in java lets us first introduce applet. Applet is a special type of program which is embedded in a webpage to generate the dynamic content. An Applet runs inside the browser and works at client side.

 

Advantages of Applet

Here are the advantages of applet in Java :

–> It works at client side so give response in less time.
–> Its secured
–> It can be executed by browsers running under various platforms, including Linux, Windows, Mac Os etc.

Disadvantages of Applet in Java

Plugin required at client side browser to run applet.

 

Example of an applet program in java

This program is based on the inter applet communication. In this program , we are selecting the color of the second applet from the first applet

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/*
<applet code="FirstApplet" height ="400" width = "200" name="first">
</applet>
<applet code="SecondApplet" height ="400" width = "200" name="second">
</applet>
*/
public class FirstApplet extends Applet implements ActionListener
{

Button b1,b2 ;
public void init()
{
b1 = new Button("red");
b2 = new Button("green");
b1.addActionListener(this);
b2.addActionListener(this);

add(b1);
add(b2);
setBackground(Color.gray);

}

public void paint (Graphics g)
{
g.drawString ("select the colour", 30,50);
g.drawString ("for second applet", 30,70);

}
public void actionPerformed (ActionEvent e)
{

AppletContext ctx = getAppletContext();
SecondApplet sa = (SecondApplet) ctx. getApplet("second");// downcasting is done here .....
if (e.getSource() == b1 )
{
sa.setBackground(Color.red);

}
if(e.getSource()== b2 )
{
sa.setBackground(Color.green);
}

}
}
Example of an applet program
AboutBeing Topper
"Being Topper, established in 2013, is a premier Digital Marketing Training institute Known for its specializing in digital marketing courses in Delhi. At Being Topper, our carefully crafted training programs are designed to offer learners the practical skills and knowledge essential for a thriving career in today's digital space. Led by certified professionals, the institute delivers top-rated courses that cover key areas, including Social Media Marketing, Pay-Per-Click advertising, content marketing and SEO. With hands-on projects and a focus on industry-specific practices, Being Topper prepares individuals to become effective digital marketing professionals, ready to excel in an increasingly digital-centric world
In Socials:
PrevWrite a C program to generate Pascal's triangle18/02/2014
Java Program for working Pacman game18/02/2014Next

Related Posts

B.tech notesBCA NOTESInformation technologyJava ProgramsPrograms/Algorithm

java program to make a GUI based calculator using frames

we are going to make a calculator’s gui … (more…)

Being Topper Admin 01/04/2014
Email MarketingEmail SecurityEmail ServicesInformation technology

The Top Features of Yahoo Mail 2025: Complete Guide to Advanced Email Tools

Yahoo Mail stands as one of the internet’s most enduring email services, with a...

Being Topper Admin 16/07/2017
Categories
Recent Posts
  • Vipin Khuttel Inspires Entrepreneurs at Networking Meet in Gurgaon
  • Vipin Khuttel Founder of Being Topper Recognized for Advancing Digital Literacy and Social Empowerment
  • Vipin Khuttel Organizes International Conference for Digital Excellence 2, Elevating the Future of Technology
  • India’s Top Occult Science Enthusiasts Gather at AgyatOnSearch – Awards & Seminar in New Delhi
  • India’s Leading Digital Marketer, Vipin Khuttel Interacted with Top Influencers of Delhi at BJP West Delhi’s Event

Copyright © 2025 Being Topper ® . All Rights Reserved