Shooting star

Assignment Help JAVA Programming
Reference no: EM13552202

Shooting Star

A Block and DoubleListOfBlock classes. You need to implement that DoubleListOfBlock methods so they perform according to the specifications (pre and post conditions). You can choose to use sentinels and pre-pointers or not, but the given methods are all that should be in the DoubleListOfBlock class. The Block class inherits JComponent to create objects that (when added) produce filled 10 by 10 squares whose color can be assigned by setBackground.

Your Driver class must implement a black JFrame and two JButton objects - one called Grow and Shrink. Note that by implementing ActionListener and calling addActionListener, your Driver can create and handle events for its own JButtons. Driver must also manipulate four DoubleListOfBlock objects -- a horizontal list, a vertical list, a major diagonal list and a minor diagonal list. All three lists are spread, centered, across the JFrame as their names imply and pictured below:

1069_Star.png

Initially, all that is visible of the four lists are four randomly-colored blocks in the center of the JFrame. Each click of the Grow button causes all four lists to grow by two Blocks from its center, thereby "pushing" the prior blocks outward by 10 pixels. All four lists must insert the same randomly-selected color as their new center Blocks.

Each click of the Shrink button causes all four lists to shrink by removing their centermost two Blocks. Both Grow and Shrink operations update the JFrame to be consistent. (You can observe this behavior in the sample applet on Riley's website.)

Selecting a random color is best accomplished by creating a java.awt.Color object and passing the Color constructor three random int parameters in the range from 0 through 255. (Math.random() returns a double in the range from 0.0 up to but not equal to 1.0.)

Using the java.awt.event.MouseListener interface, cause your Block objects to handle events in the following way. Every time that a Block is clicked, that Block and all other Blocks equidistant from the center of the four lists are all colored white.

Reference no: EM13552202

Questions Cloud

Define the vapor pressure of ccl3f : The vapor pressure of CCl3F at 300 K is 856 torr. If 11.5 g of CCl3F is enclosed in a 1.2 -L container, will any liquid be present. If so, what mass of liquid
How long does it take ironman to catch the fellow : Ironman is chasing a bad guy who is running at 7.2 m/s. When he is 143m behind the bad guy, How long does it take Ironman to catch the fellow
Obtain how high does the rocket travel : a model rocket is fired vertically from rest. It has acceleration of 14.2m/s^2. how high does the rocket travel
The density of a human body can be the density of water : The density of a human body can be approximated by the density of water, which is equal to 1.000 x 103 kg/m3. What volume will a 185 lb person occupy in liters
Shooting star : Initial project folder you will see the beginnings of a Driver - You need to implement that DoubleListOfBlock methods so they perform
What is the speed of the ball at the highest point : a ball is thrown from a point 1.0m above the ground. the initial velocity is 6.8m/s at an angle of 30 degrees above the horizontal. What is the speed of the ball at the highest point
Through what distance does the point move in one revolution : A rotating fan completes 1200 revolutions every minute. Consider a point on the tip of a blade, at a radius of .20 m.
What is the minimum number of photons : The ultraviolet excimer laser used in the PRK technique (see Section 30.9) has a wavelength of 193 nm. What is the minimum number of photons
How long does the ball take to reach the wall : You throw a ball torwards a wall at speed 21 m/s and an angle of 40 degrees above the horizontal. The wall is 22.0 m from the release point of the ball.

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