• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Layout of Swing program question

 
Ranch Hand
Posts: 63
IntelliJ IDE Redhat Java
  • 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().

 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!