java.lang.Object
is.codion.swing.common.ui.Sizes

public final class Sizes extends Object
Utility class for setting component sizes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends JComponent>
    T
    setMaximumHeight(T component, int maximumHeight)
    Sets the maximum size of the given component to its current width and the given maximumHeight
    static <T extends JComponent>
    T
    setMaximumWidth(T component, int maximumWidth)
    Sets the maximum size of the given component to its current height and the given maximumWidth
    static <T extends JComponent>
    T
    setMinimumHeight(T component, int minimumHeight)
    Sets the minimum size of the given component to its current width and the given minimumHeight
    static <T extends JComponent>
    T
    setMinimumWidth(T component, int minimumWidth)
    Sets the minimum size of the given component to its current height and the given minimumWidth
    static <T extends JComponent>
    T
    setPreferredHeight(T component, int preferredHeight)
    Sets the preferred size of the given component to its current width and the given preferredHeight
    static <T extends JComponent>
    T
    setPreferredWidth(T component, int preferredWidth)
    Sets the preferred size of the given component to its current height and the given preferredWidth

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • setPreferredWidth

      public static <T extends JComponent> T setPreferredWidth(T component, int preferredWidth)
      Sets the preferred size of the given component to its current height and the given preferredWidth
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      preferredWidth - the preferred width
      Returns:
      the component
    • setPreferredHeight

      public static <T extends JComponent> T setPreferredHeight(T component, int preferredHeight)
      Sets the preferred size of the given component to its current width and the given preferredHeight
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      preferredHeight - the preferred height
      Returns:
      the component
    • setMinimumWidth

      public static <T extends JComponent> T setMinimumWidth(T component, int minimumWidth)
      Sets the minimum size of the given component to its current height and the given minimumWidth
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      minimumWidth - the minimum width
      Returns:
      the component
    • setMinimumHeight

      public static <T extends JComponent> T setMinimumHeight(T component, int minimumHeight)
      Sets the minimum size of the given component to its current width and the given minimumHeight
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      minimumHeight - the minimum height
      Returns:
      the component
    • setMaximumWidth

      public static <T extends JComponent> T setMaximumWidth(T component, int maximumWidth)
      Sets the maximum size of the given component to its current height and the given maximumWidth
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      maximumWidth - the maximum width
      Returns:
      the component
    • setMaximumHeight

      public static <T extends JComponent> T setMaximumHeight(T component, int maximumHeight)
      Sets the maximum size of the given component to its current width and the given maximumHeight
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      maximumHeight - the maximum height
      Returns:
      the component