This applet program needs an html file to run.

Assignment Help JAVA Programming
Reference no: EM13941648

This applet program needs an html file to run. You should supply the file along with the program so that the reader can test it.

import java.applet.*;
import java.awt.*;

public class DrawRectangles extends Applet {

int width, height;

public void init() {
width = getSize().width;
height = getSize().height;
setBackground( Color.white );
}

public void paint( Graphics g ) {

//(back, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white and yellow)
drawRectangle(g,Color.black,10,10);
drawRectangle(g,Color.blue,10,40);
drawRectangle(g,Color.cyan,10,70);
drawRectangle(g,Color.darkGray,10,100);
drawRectangle(g,Color.pink,10,130);
drawRectangle(g,Color.green,10,170);
drawRectangle(g,Color.lightGray,10,200);
drawRectangle(g,Color.magenta,10,230);
drawRectangle(g,Color.orange,10,260);
drawRectangle(g,Color.red,10,290);
drawRectangle(g,Color.white,10,320);
drawRectangle(g,Color.yellow,10,350);
drawRectangle(g,Color.gray,10,380);
}

public void drawRectangle(Graphics g,Color c,int x,int y)
{

g.setColor( c );
g.fillRect( x, y, 280, 280 );
}
}

Attachment:- DrawRectangles.zip

Reference no: EM13941648

Questions Cloud

What is the manufacturer markup percentage : What is the manufacturer's markup percentage? _______________________, What is the retailer's markup in dollars?______________________________.
Projections given for price-quantity and variable costs : We are evaluating a project that costs $1059720, has a seven-year life, and has no salvage value. Assume that depreciation is straight-line to zero over the life of the project. Sales are projected at 40776 units per year. What is the NPV of the proj..
Differences between the company product : Identify the key competitor products (top 2 or 3) and describe the differences between the company's product(s) and their closest competitor's products.
Discuss the message execution : Discuss the message execution (slice of life, lifestyle, fantasy, mood/image, musical, personality, technical expertise, scientific evidence, testimonial/endorsement)
This applet program needs an html file to run. : This applet program needs an html file to run. You should supply the file along with the program so that the reader can test it.
Effectively manage work related stressors : A manager's job is varied and hectic and managers will often find themselves under much job-related stress. (Hitt, Black and Porter, 2008) Evaluate critically the strategies that 21st Century businesses could use to effectively manage work related s..
What is the expected return for this asset : Assume that next year, we can have three possible states of world with the following probabilities of occurring: 20%, 45%, and 35%. The returns of an asset in each state are 18%, 5%, and -8%. What is the expected return for this asset?
Greatest contributor to competitive advantage : Use the criteria for making a difference to identify which differences appear to be the greatest contributor to competitive advantage.
Evaluating an extra dividend versus share repurchase : Flashback Corporation is evaluating an extra dividend versus a share repurchase. In either case, $21,060 would be spent. Current earnings are $3.60 per share, and the stock currently sells for $90 per share. What will Flashback’s EPS and PE ratio be ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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