public final class ComponentUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
centerComponentInComponent(java.awt.Component parent,
java.awt.Component toBeCentered)
Use this static method if you want to center a component over another
component.
|
static void |
centerComponentInWindow(java.awt.Component component)
Use this static method if you want to center a component in Window.
|
static void |
centerComponentInWindow(java.awt.Component component,
int percentOfScreen)
Use this static method if you want to center and set its position
compared to the size of the current users screen size.
|
public static void centerComponentInWindow(java.awt.Component component, int percentOfScreen)
component
- the component you want to center and set size onpercentOfScreen
- the percent of the current screensize you want the component
to bepublic static void centerComponentInWindow(java.awt.Component component)
component
- the component you want to center in windowpublic static void centerComponentInComponent(java.awt.Component parent, java.awt.Component toBeCentered)
parent
- the component you want to use to place it ontoBeCentered
- the component you want to centerCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.