Hello everyone! I am doing resolution adaptation in the JAVA2D environment, hoping that the UI interface will be distorted when switching screens. How to lock the resolution in JAVA2D rendering environment? Thanks!
Not sure exactly what you are hoping to achieve but you might want to look at setResizable
If you want to distort the display to ‘fit’ the new size I can think of 2 alternatives
scale change the scale based on the previous and the new display size
in the draw method all positions and sizes used for draw commands e.g. line, rect, ellipse etc. are expressed as a proportion of the display width and height