Here you can find the source of getSizeWithScreen(double xd, double yd)
public static Dimension getSizeWithScreen(double xd, double yd)
//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(); } }