Home » Java programs » Java applet programs

Java Applet program to print a welcome message



Here, we are implementing a java program in applet that will print a welcome message on the screen.
Submitted by Chandra Shekhar, on January 11, 2018

Given co-ordinates under which we have to print a welcome message using Java applet program.

In this example, we are using a function named g.drawString() which is a method of Graphics class, here g is an object of Graphics class. drawString() is taking three parameters string to display and x,y co-ordinates.

Applet program to print welcome message in Java

// This java program Welcomes you using Applet.

package Applet;

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

public class WelcomeToApplet extends Applet
{
	// create paint class to print on the screen.
	public void paint (Graphics g)
	{		
		// Enter message with co-ordinates to make it in centre.
		g.drawString ("Welcome To Includehelp", 25, 50);
	  
	}
}

Output

Welcome message in java applet





Quick links:
C FAQ(s) C Advance programs C/C++ Tips & Tricks Puzzles JavaScript CSS Python Linux Commands PHP Android Articles More...

Was this page helpful? Please share with your friends...

Are you a blogger? Join our Blogging forum.




Comments and Discussions





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com (2015-2018), Some rights reserved.