The Artima Developer Community
Sponsored Link

Java Answers Forum
help me plz "where is the rong in this code "

1 reply on 1 page. Most recent reply: Apr 19, 2004 6:16 AM by twc

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
sara

Posts: 2
Nickname: sarabirdie
Registered: Apr, 2004

help me plz "where is the rong in this code " Posted: Apr 18, 2004 5:09 AM
Reply to this message Reply
Advertisement
Hello ,
I tryed this code to do copy and past in my editor but it does not work
can help me to Know what is the problem PLZ?

When I " copy" an object"eg.rectangle shape" than paste , the old one
(old copy of the object) does not move.
note devices is array of shape.
Device CopyDevice[]= new Device[10];

public void Copy(){

for(int i=0; i< canvas.devices.length; i++)
{
if(canvas.devices.getActiveSelected()==1)
{
CopyDevice= canvas.devices;
indexCopy= i;
}
}

}


public void Past(){


for(int i=0; i< CopyDevice.length; i++)
{ CopyDevice.DeSelect();

canvas.devices[canvas.nextId] =CopyDevice;
canvas.devices[canvas.nextId].getUpperLeft().translate(4,4);
canv as.devices[canvas.nextId].draw(CopyDevice.getUpperLeft());

++canvas.nextId;
}


}


twc

Posts: 129
Nickname: twc
Registered: Feb, 2004

Re: help me plz "where is the rong in this code " Posted: Apr 19, 2004 6:16 AM
Reply to this message Reply
If you are copying something, I would expect the "old" item to remain. It should only disappear if you are "moving" it.

twc

Flat View: This topic has 1 reply on 1 page
Topic: Mapping dependent objects in entity beans Previous Topic   Next Topic Topic: Simulation of Lamport logical clock in java[RMI]

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use