Java applet programming examples, JAVA Programming

Assignment Help:

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.


Related Discussions:- Java applet programming examples

Difference between object state and behavior, What is difference between ob...

What is difference between object state and behavior? Ans) If you change the state of an object, you ask it to perform a behavior. An object kept its states in a field e.g. vari

Pseudocode, Create an application for an animal-fur trimming service. The b...

Create an application for an animal-fur trimming service. The business is open 15 weeks of the year, from April through July. The fee for a small animal (under 6 pounds) is $100, a

Explain data updates issues in data management, Explain Data Updates issues...

Explain Data Updates issues in data management? DATA UPDATES: Old titles must be removed regularly Data changes every time Prices change Transportation / shipping cost change

Define the life cycle methods of a servlet? , The Web container is used for...

The Web container is used for managing the servlet's life cycle. The Web container produces an instance of the servlet and then the container invokes the init() function. At the co

Password Generator Software, In this exercise, I want you to generate passw...

In this exercise, I want you to generate password based on random number generator. Develop an application that keeps track of the URL, username and password. I have listed few st

Design patterns which are used in struts , Struts is depend on m...

Struts is depend on model 2 MVC (Model-View-Controller) architecture. Struts controller uses the command design pattern and the action classes use the adapter design pattern. The p

Develop a desktop chatbot application, Develop a desktop Chatbot applicatio...

Develop a desktop Chatbot application Project Description: Looking for an in depth and smart working chatbot Seeking someone with skills working with AI and chatbots and t

Explain the rules for tostring() methods, Explain the Rules for toString() ...

Explain the Rules for toString() Methods ? toString() methods should return a single line of text that does not contain any carriage returns or linefeeds. toString() methods

What does tcp/ip stand for, What does TCP/IP stand for? TCP/IP is a Pro...

What does TCP/IP stand for? TCP/IP is a Protocol type basically it is known by Transmission Control Protocol/Internet Protocol

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd