Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6 Creating an Applet with a Background Color In preparation for creating your own personal Web page you would like to vie ossible background colors

image text in transcribed
image text in transcribed
6 Creating an Applet with a Background Color In preparation for creating your own personal Web page you would like to vie ossible 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 backarou You will use the setBackground) method, which accepts a color argument in applets 1. Start TextPad. Save the file as Java source code with the file name MyColorApplet. 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 MyColorApplet. Remember to extend the Apple class. Include an opening brace for the class. 5. Write a method header for the paint( method. Include an opening bra the method. t the background color to yellow. UIse the drawString(0 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. 1o. On the TextPad 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 12. Run the program. 13. Edit the program several times and change the color to red, blue, cyan, and specify the HTML (*.htm*, *.stm*) file type. orange. Compile and then run the program after each color change

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

(3) Let f: {|z| Answered: 1 week ago

Answered: 1 week ago