0

I have some code that code that's supposed to animate parts of my program, and right now, the animation dimensions are hard coded, i.e. every distance and location is specified by a number. I was just wondering, is there a way to rescale the animation panel, so that the hard-coded thing will work on computers with smaller screens?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 1
    Yes, don't hard code values. Instead use methods like `getWidth()` and `getHeight()` to get the size of the panel. Then base you logic of the actual width/height of the panel. – camickr Nov 24 '13 at 23:39

1 Answers1

1

Use a scale instance of an AffineTransform for this. Here is an example of scaling text.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433