Class Px


public class Px extends Units
CSS pixel (px) unit value.

Pixels are absolute-length units that represent a single dot on the screen. The actual size of a pixel is relative to the viewing device - on high-DPI displays, one CSS pixel may consist of multiple device pixels.

Usage:


 Units size = new Px(16);
 element.setWidth(new Px(300));
 element.setFontSize(new Px(14));
 
Since:
2016
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Px

      public Px(float value)
      Constructs a Px unit with the specified value.
      Parameters:
      value - the pixel value
  • Method Details

    • sizeToString

      public String sizeToString()
      Returns the CSS string representation of this pixel value.
      Specified by:
      sizeToString in class Units
      Returns:
      the CSS value string (e.g., "16px")