questiona the following is a simple example of a


Question:

(a) The following is a simple example of a Java Class:

// File: Welcome.java
public class Welcome {
public static void main(String args[]) {
System.out.println("Welcome to Java World");
}
}

Convert this file into an applet that prints out the same message when it is executed on a web page. Ensure that the text is written at the pixel position (10, 10) from the top left corner of the applet window.

(b) We will now call this applet from inside a web page. Suppose we wish to display the applet inside an applet window that is 200 pixels wide and 50 pixels high. What is the line of html code that needs to be inserted into an html file to do this?

(c) Now modify the applet from Part (a) so that the text is written out with the following properties: Font is Arial, Bold; Font size is 26 point; Text colour is blue.

(d) In Part (c), the text string and the font size have been "hard-wired" into the applet definition. However, we can pass both of these in to the applet as parameters. Modify the code you have written so far to enable both the text to be written on the screen, and the font size to be entered as parameters.

(e) Now we can reuse the applet in a number of different web pages, and print out different strings in different sizes. Write down the html fragment that will enable the applet to be called, with parameter values for the text string and font size set as "Aren't I clever!", and 18, respectively.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: questiona the following is a simple example of a
Reference No:- TGS0361052

Expected delivery within 24 Hours