File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
src/main/java/util/general Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 66public class SystemHelper {
77 public static boolean isRetinaDisplay (Graphics2D g ) {
88 boolean isRetina = false ;
9- GraphicsDevice graphicsDevice = GraphicsEnvironment .getLocalGraphicsEnvironment ().getDefaultScreenDevice ();
10-
119 try {
12- Field field = graphicsDevice .getClass ().getDeclaredField ("scale" );
13- if (field != null ) {
14- field .setAccessible (true );
15- Object scale = field .get (graphicsDevice );
16- if (scale instanceof Integer && ((Integer ) scale ).intValue () == 2 ) {
17- isRetina = true ;
10+ GraphicsDevice graphicsDevice = GraphicsEnvironment .getLocalGraphicsEnvironment ().getDefaultScreenDevice ();
11+
12+ try {
13+ Field field = graphicsDevice .getClass ().getDeclaredField ("scale" );
14+ if (field != null ) {
15+ field .setAccessible (true );
16+ Object scale = field .get (graphicsDevice );
17+ if (scale instanceof Integer && ((Integer ) scale ).intValue () == 2 ) {
18+ isRetina = true ;
19+ }
1820 }
21+ } catch (Exception e ) {
22+ e .printStackTrace ();
1923 }
20- } catch (Exception e ) {
24+ }catch (Exception e ){
2125 e .printStackTrace ();
2226 }
2327 return isRetina ;
You can’t perform that action at this time.
0 commit comments