Question: *Adjust the code below so that it draws a cube, not a rectangle* Please see the following link, it contains the data you may need.

*Adjust the code below so that it draws a cube, not a rectangle*

Please see the following link, it contains the data you may need.

https://drive.google.com/file/d/1PdL7WR-GbifAiRYPzIt6zx7Nw_xrwJDD/view

code

=======================================

import java.awt.*; import java.awt.geom.*; import javax.swing.*;

public class CubeJPanel extends JFrame { public CubeJPanel() { super("Drawing 2D Cube"); setSize(400,400); setVisible(true); } public void paint(Graphics g) { super.paint(g);

int xPoint[]={200,300,300,200,200,130,230,230,130,130}; int yPoint[]={200,200,300,300,200,70,70,170,170,70};

Graphics2D g2d =(Graphics2D)g; GeneralPath cube = new GeneralPath();

cube.moveTo(xPoint[0],yPoint[0]); for( int i=1;i

} public static void main(String args[]) { CubeJPanel m= new CubeJPanel(); m.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }

=============================

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!