java.lang.Object
is.codion.swing.common.ui.component.Sizes
Utility class for setting component sizes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends JComponent>
TmaximumHeight
(T component, int maximumHeight) Sets the maximum size of the given component to its current width and the givenmaximumHeight
static <T extends JComponent>
TmaximumWidth
(T component, int maximumWidth) Sets the maximum size of the given component to its current height and the givenmaximumWidth
static <T extends JComponent>
TminimumHeight
(T component, int minimumHeight) Sets the minimum size of the given component to its current width and the givenminimumHeight
static <T extends JComponent>
TminimumWidth
(T component, int minimumWidth) Sets the minimum size of the given component to its current height and the givenminimumWidth
static <T extends JComponent>
TpreferredHeight
(T component, int preferredHeight) Sets the preferred size of the given component to its current width and the givenpreferredHeight
static <T extends JComponent>
TpreferredWidth
(T component, int preferredWidth) Sets the preferred size of the given component to its current height and the givenpreferredWidth
-
Method Details
-
preferredWidth
Sets the preferred size of the given component to its current height and the givenpreferredWidth
- Type Parameters:
T
- the component type- Parameters:
component
- the componentpreferredWidth
- the preferred width- Returns:
- the component
-
preferredHeight
Sets the preferred size of the given component to its current width and the givenpreferredHeight
- Type Parameters:
T
- the component type- Parameters:
component
- the componentpreferredHeight
- the preferred height- Returns:
- the component
-
minimumWidth
Sets the minimum size of the given component to its current height and the givenminimumWidth
- Type Parameters:
T
- the component type- Parameters:
component
- the componentminimumWidth
- the minimum width- Returns:
- the component
-
minimumHeight
Sets the minimum size of the given component to its current width and the givenminimumHeight
- Type Parameters:
T
- the component type- Parameters:
component
- the componentminimumHeight
- the minimum height- Returns:
- the component
-
maximumWidth
Sets the maximum size of the given component to its current height and the givenmaximumWidth
- Type Parameters:
T
- the component type- Parameters:
component
- the componentmaximumWidth
- the maximum width- Returns:
- the component
-
maximumHeight
Sets the maximum size of the given component to its current width and the givenmaximumHeight
- Type Parameters:
T
- the component type- Parameters:
component
- the componentmaximumHeight
- the maximum height- Returns:
- the component
-