Question
The question refers to the API. Here is what I have based off of my notes. import java.awt.*; import imagePackage.RasterImage; public class Exercise01 { public
The question refers to the API. Here is what I have based off of my notes.
import java.awt.*; import imagePackage.RasterImage;
public class Exercise01 {
public static RasterImage image = new RasterImage(300,300);
public static Graphics2D gfx = image.getGraphics2D();
public static Color imageCol = Color.BLUE;
public static void main(String[] args) { /* * REVIEW EXERCISE: * * Use the services of the class RasterImage to construct a raster image object * that is 300x300 pixels and is all blue (use the java.awt.Color to modify the * color of all the pixels in the image after it is created). * Change the titlebar of the window to "Lab 02". Note that this can only be done * after the image object is displayed in a window. * * The package with the RasterImage class (and other relevant classes) can * be found in this project. The API for the Picture class can be found * in the "doc" folder of this project. * * Locate the necessary services (methods) within the RasterImage class for this task. * * NB: You may need to add import statements to this class definition. */
image.show();
image.setTitle("Lab02");
gfx.setColor(imageCol);
gfx.fillRect(0, 0, 300, 300);
} }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started