Class ProportionalPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ProportionalPanel extends JPanel
A JPanel whose preferred size keeps its aspect ratio.
See Also:
  • Constructor Details

    • ProportionalPanel

      public ProportionalPanel()
      Uses an A4 portrait ratio.
    • ProportionalPanel

      public ProportionalPanel(int w, int h)
    • ProportionalPanel

      public ProportionalPanel(double widthOverHeightRatio)
  • Method Details

    • getWidthOverHeightRatio

      public double getWidthOverHeightRatio()
      Returns:
      the widthOverHeightRatio
    • setWidthOverHeightRatio

      public void setWidthOverHeightRatio(double widthOverHeightRatio)
      Parameters:
      widthOverHeightRatio - the widthOverHeightRatio to set
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent