Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to move many balls at a time using thread  RSS feed

 
Preethi sakar
Greenhorn
Posts: 19
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am try to move 2 ball at same time in different position but only one ball is display.

Can any one tell solution for that??

Here is my code
I used two class one extends JPanel and another for JFrame




 
Campbell Ritchie
Sheriff
Posts: 55292
156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't. Swing is not thread‑safe. Find about the Swing Timer class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!