Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*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

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions