C C++ Java Data Structure Python JavaScript CSS Ajax PL/SQL PHP Puzzles C programs C++ programs Java programs



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






You may also be interested in...

C/C++ Tips and Tricks...

Was this page helpful? YES NO

Are you a blogger? Join our Blogging forum.


Comments and Discussions