Question: I am new to using Eclipse and Java and need some help with a homework assignment. I am using Java 11. I did the first

I am new to using Eclipse and Java and need some help with a homework assignment. I am using Java 11. I did the first part but the second part is where I am totally lost. Any help would be greatly appreciated. I have added the UMP diagram and the grid class implementation below.I am new to using Eclipse and Java and need some help

with a homework assignment. I am using Java 11. I did the

Grid Class Implemn

package portrait;

import java.awt.Color; import java.awt.Graphics2D;

/** * * @author tompkinsj * */ public class Grid {

private int w; private int h; private int x; private int y; private boolean showGrid = false;

public Grid(int x, int y, int w, int h) { this.x = x; this.y = y; this.w = w; this.h = h;

}

public void display(Graphics2D g2) {

for (int x1 = x; x1 0) { g2.setColor(Color.lightGray); g2.drawString("" + x1, x1, 15); } g2.drawLine(x1, 0, x1, h); } for (int y1 = y; y1

}

public void toggleGrid() { showGrid = !showGrid; } public boolean isVisible() { return showGrid; }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!