The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

turning array into something i can use

Posted by drewdowling on January 25, 2001 at 12:16 PM

i need help to turn a array [4][7] containing the x and y coordinates
of points into into 5 rectangles.
I think the code is something like this:


import java.awt.*;
import java.awt.event.*;

class Graphics

Panel panel = null;
Graphics (Panel panel1){
panel=panel1;
int i = 0
while(i = 0, i < houseArray.length, i++){
int x = houseArray[i][0];
int z = houseArray[i][1];
int a = houseArray[i][4];
int b = houseArray[i][5];
int width = a - x;
int height = b - z;
Graphics gc = panel.getGrapgics;
gc.drawrect(x,y,width,height);
}

is this close?
how do i bring my array in from another class?




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us