Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

[JAVA] how to move the triangle by timer

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, for the code below i managed to make the rectangle moved to the left and bounce back at jpanel width.  But how to make the triangle move horizontally (doesnt matter to the left or right) ? Before this i can make the triangle move by pinpoint the triangle coordinate point by using {..triangle.addPoint(x, y)...}  . but when i used to make the triangle using constructor and arrays, how can i make the triangle move by TIMER? What need i do with the x1 and velx1 variable?

Thank you



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic