Moving Objects On Button Click

i was just woundering how to make an object e.g. (Rectangle Block) move on the click of a button

privatevoid btn_MoveLeftMouseClicked(java.awt.event.MouseEvent evt){

//move left

}

Thanks Rich

[373 byte] By [Jefferiesa] at [2007-10-3 11:09:22]
# 1
Please be more descriptive: http://catb.org/esr/faqs/smart-questions.html
zadoka at 2007-7-15 13:32:26 > top of Java-index,Java Essentials,New To Java...
# 2
My modifying the data model accordingly, to be able to paint a modified representation on the next view update.
CeciNEstPasUnProgrammeura at 2007-7-15 13:32:26 > top of Java-index,Java Essentials,New To Java...
# 3
In other words:* in listener:theObjectToPaint.setCoordinate(x,y);panel.repaint();* in painttheObjectToPaint.getCoordinates(x,y);-- ortheObjectToPaint.paintYourself(graphics);
CeciNEstPasUnProgrammeura at 2007-7-15 13:32:26 > top of Java-index,Java Essentials,New To Java...
# 4
you have several separate issues to explore, don't try and tackle them in one lump1) how to make an object move2) how to capture button events3) how to invoke the object-moving code from event-capturing code
georgemca at 2007-7-15 13:32:26 > top of Java-index,Java Essentials,New To Java...
# 5

> 1) how to make an object move

> 2) how to capture button events

> 3) how to invoke the object-moving code from

> event-capturing code

4) Don't assume that whatever you painted somewhere can be picked up and modified. You can't do that with a real piece of paper, either. You need to draw it again from the start.

CeciNEstPasUnProgrammeura at 2007-7-15 13:32:26 > top of Java-index,Java Essentials,New To Java...