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?
Asked
Active
Viewed 26 times
0
-
1Yes, 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 Answers
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