Class MonitorDimension

java.lang.Object
com.compomics.util.gui.MonitorDimension

public class MonitorDimension
extends Object
This class makes it possible to set the dimensions of a JFrame of JPanel to a certain percentage of the screen size.
  • Constructor Details

  • Method Details

    • getPercentualScreenDimension

      public static Dimension getPercentualScreenDimension​(JFrame frame, double aPercentage)
      This method returns a Dimension with a percentual width and height in relation to the JFrame.
      Parameters:
      frame - Source dimension
      aPercentage - Percentual width and height of the returning dimension.
      Returns:
      A Dimension instance with a percentual Dimension in relation to the JFrame.
    • getPercentualScreenDimension

      public static Dimension getPercentualScreenDimension​(JPanel jpan, double aPercentage)
      This method returns a Dimension with a percentual width and height in realtion to the JPanel.
      Parameters:
      jpan - Source Dimension
      aPercentage - Percentual width and height of the returning dimension.
      Returns:
      A Dimension instance with a percentual Dimension in relation to the JPanel.