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

Layout of Swing program question  RSS feed

 
Timmy Ryan
Ranch Hand
Posts: 63
IntelliJ IDE Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

This is a cut down program that randomly draws 50 * around the screen and makes them move around.
The code does what I want but if anybody has any suggestions on how the code could be structured better it would be much appreciated.
As in when I improve on the program and want to get the objects to interact with each other should i put the code for that in the paintMethod().

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Things work better if you separate your drawing code from your event code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!