Write the class header for my color applet

Assignment Help JAVA Programming
Reference no: EM131937196

Problem

Creating an Applet with a Background Color In preparation for creating your own personal Web page, you would like to view some possible background colors that will be easy to read with black text. You decide to write a Java applet that displays black words on a colored background. You will use the setback ground() method, which accepts a color argument in applets.

1. Start Text Pad. Save the file as Java source code with the file name My Color Applet.

2. Type a block header with the information about you and the assignment.

3. Import the java.awt.* and java.applet.* packages.

4. Write the class header for My Color Applet. Remember to extend the Applet class. Include an opening brace for the class.

5. Write a method header for the paint() method. Include an opening brace for the method.

6. Set the background color to yellow.

7. Use the draw String() method to print the words "This is a color test" at the coordinates 25 and 30.

8. Enter closing braces to close the method and class.

9. Compile the program. Fix errors as necessary.

10. On the Text Pad menu bar, click File and then click New. Type the HTML code to reference the MyColor.class with a width of 400 and a height of 200. Be sure to include the start and end tags.

11. Save the HTML document with the filename MyColorApplet. Make sure you specify the HTML (*.htm*,*.stm*) file type.

12. Run the program.

13. Edit the program several times and change the color to red, blue, cyan, and orange. Compile and then run the program after each color change.

Text Book: Java Programming: Comprehensive Concepts and Techniques By Gary B. Shelly, Thomas J. Cashman, Joy L. Starks, Michael Mick.

Reference no: EM131937196

Questions Cloud

What is the specific heat for the metal : It takes 52.0J to raise the temperature of an 8.30g piece of unknown metal from 13.0 °C to 25.0 °C. What is the specific heat for the metal?
Predict the sign-positive negative or zero : Delta G, Delta S and Delta H for the dissolution of sodium sulfate in water. ( Experiment shows that dissolving sodium sulfate in water casues the temperture
Write a java application to display name of store on screen : Write a Java application to display the name of the store on the screen. Use appropriate documentation lines. Compile the program and execute it.
What is the temperature : What is the temperature (in °C) of an 11.7 L sample of carbon monoxide, CO, at 747 torr if it occupies 12.6 L at 59.2°C and 747 torr?
Write the class header for my color applet : Write the class header for My Color Applet. Remember to extend the Applet class. Include an opening brace for the class.
Calculate the number of moles of nitrogen gas : Calculate the number of moles of nitrogen gas (N2) that are needed to inflate a 67-L driver-side air bag at standard temperature (0°C) and pressure
Create an html host document that calls splash applet class : Create an HTML host document that calls the Splash Applet class. Set the attributes of the applet to have a width of 400 and a height of 300 when it displays.
Explain why le chatelier principle is equivalent : Explain why Le Chatelier's Principle is equivalent to saying that a system at chemical equilibrium will be stable against small fluctuations.
Control the ph of physiological fluids : A buffer, consisting of H2PO4^1- and HPO4^2-, helps control the pH of physiological fluids. Many carbonated soft drinks also use this buffer system.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Function searches all files specified on the command line

Write a program Find that searches all files specified on the command line and prints out all lines containing a reserved word. For example, if you call java Find ring report.txt address.txt Homework.java, then the program might print:

  In this project you need to write a program called

in this project you need to write a program called ecc.javato implement elliptic curve

  Short java paper

Using the simplified OOD methodology:

  Design and implement an applet called circles

Design and implement an applet called Circles that draws 50 circles of random diameter in random locations. If the diameter of a circle is less than a certain value, the circle is ?lled with the color yellow.

  Write a java program that will play connect four

Write a java program that will play connect four - Must be a simple program no applets, jframes.

  Create a world class that contains a 2d array

You have to create a world class that contains a 2d array then create an abstract class called organism that contains move() method the organism should move randomly one step at the time.

  Implement a standalone desktop game

Description - The goal of the class project is to implement a standalone desktop game. This game is a 2D game cop and robbers game, called RIC Racers, which is closely modeled after the C.A.P online flash game Robbers vs. Cops

  Create a document using your favorite word processor

Create a document using your favorite word processor and type your exercise solutions. At the top of the document be sure to include your name and the homework

  Compares the two strings starting from index

Create a Simon says loop that compares the two strings starting from index 0. For each match, add one point to userScore.

  How large a value can be stored in an integer variable

Most programming languages have a built-in integer data type. Normally this representation has a fixed size, thus placing a limit on how large a value can be stored in an integer variable

  Create a class called employee

Create a class called Employee that has the following attributes: Employee ID of type String, First name of type String, Last name of type String

  Use the testcircle.java program to test your classes

Create a new class, Point, which inherits from Shape and contains two private instance variables of type int, x and y, which store the coordinates for the Point

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