Java Screen Size getSizeWithScreen(double xd, double yd)

Here you can find the source of getSizeWithScreen(double xd, double yd)

Description

get Size With Screen

License

Open Source License

Declaration

public static Dimension getSizeWithScreen(double xd, double yd) 

Method Source Code

//package com.java2s;
/*/*w ww.  j ava2 s  .  c  om*/
 * Copyright (C) 2015 Jack Jiang(cngeeker.com) The DroidUIBuilder Project. 
 * All rights reserved.
 * Project URL:https://github.com/JackJiang2011/DroidUIBuilder
 * Version 1.0
 * 
 * Jack Jiang PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * Utils.java at 2015-2-6 16:12:00, original version by Jack Jiang.
 * You can contact author with jb2011@163.com.
 */

import java.awt.Dimension;

import java.awt.Toolkit;

public class Main {

    public static Dimension getSizeWithScreen(double xd, double yd) {
        Dimension d = getScreenSize();
        double width = d.getWidth() * xd;
        double height = d.getHeight() * yd;
        d = new Dimension((int) width, (int) height);
        return d;
    }

    public static Dimension getScreenSize() {
        return Toolkit.getDefaultToolkit().getScreenSize();
    }
}

Related

  1. getMaximumWindowWidth()
  2. getMaxSize(Window frame)
  3. getMaxUsableScreenSize()
  4. getMaxWindowSize()
  5. getMinimumCacheSize(int tileSize, double overdrawFactor)
  6. getSystemSizeRate()
  7. getWindowActualSize(final Window window)
  8. makeEllipse(double x, double y, double size)
  9. maximizeWindowWithMargin(final Window window, final int margin, final Dimension maxSize)