Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a comment for each line : import java.awt.Component; import java.awt.Graphics; import java.awt.Image; import java.awt.Rectangle; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class ColorableBlocks extends

Write a comment for each line :

import java.awt.Component; import java.awt.Graphics; import java.awt.Image; import java.awt.Rectangle; import java.io.File; import java.io.IOException;

import javax.imageio.ImageIO;

public class ColorableBlocks extends Rectangle {

Image pic; boolean destroyed; int movX,movY;

ColorableBlocks(int x, int y, int w, int h, String s) { this.x = x; this.y = y; movX = 3; movY = 3;

this.width = w; this.height = h; try { pic = ImageIO.read(new File("src/"+s)); } catch (IOException e) { e.printStackTrace(); } }

public void draw(Graphics g, Component c) { if (!destroyed) g.drawImage(pic, x, y, width, height, c); }

}

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

7. What is coaching? Is there only one type of coaching? Explain.

Answered: 1 week ago