Results 1 to 6 of 6
Thread: moving square
- 01-22-2010, 04:14 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 4
- Rep Power
- 0
- 01-22-2010, 04:54 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
First you have to clear the component and draw the square at position (x1, y1); then you wait a bit or do something else and then you repeat the clearing and drawing at position (x2, y2); repeat for position (x3, y3), (x4, y4) etc.
Note that you have to do the waiting in another thread, i.e. not in Swing's EDT thread. The repainting can simply be accomplished by calling a repaint() on the component that does the drawing of the square at a certain position.
kind regards,
Jos
- 01-22-2010, 05:46 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 4
- Rep Power
- 0
pls
where do i will start?
- 01-22-2010, 05:52 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
By reading the Sun Tutorials?
kind regards,
Jos
- 01-22-2010, 05:52 PM #5
Member
- Join Date
- Jan 2010
- Posts
- 4
- Rep Power
- 0
i need it like this there will be 2 buttons when i click the run botton the square will move and when i click the stop button it will stop
- 01-22-2010, 05:58 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
How can I square(^2) the pic in the grid
By racewithferrari in forum New To JavaReplies: 2Last Post: 11-03-2009, 05:27 PM -
How can I square(^2) the pic in the grid
By racewithferrari in forum New To JavaReplies: 1Last Post: 11-01-2009, 10:16 PM -
Display Square Roots
By hypes057 in forum New To JavaReplies: 8Last Post: 08-25-2009, 10:34 AM -
Simple square root problem!
By nortski in forum New To JavaReplies: 7Last Post: 04-01-2009, 02:11 PM -
8-Square puzzle loop
By SapphireSpark in forum New To JavaReplies: 7Last Post: 12-04-2008, 07:21 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks