Q:

Java Applet program to print a welcome message

0

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.

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now