Guest User

Untitled

a guest
Jun 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Toolkit tk = Toolkit.getDefaultToolkit();
  2. Dimension d = tk.getScreenSize();
  3. System.out.println("Your screen has width: " + d.width + " and height: " + d.height);
  4. int tempWidth = d.width;
  5. int tempHeight = d.height;
  6.  
  7. OperatingSystemMXBean osMXBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
  8. long memory = osMXBean.getTotalPhysicalMemorySize();
  9.  
  10. if(d.width > 1280 && memory < 1000000000)
  11. {
  12. tempWidth = 1280;
  13. tempHeight = d.height * 1280 / d.width;
  14. }
  15. this.view = new View(tempWidth, tempHeight, true, "Lilu & Lila");
Add Comment
Please, Sign In to add comment