org.apache.jorphan.gui
Class ComponentUtil
public final class ComponentUtil
This class is a Util for awt Component and could be used to place them in
center of an other.
static void | centerComponentInComponent(Component parent, Component toBeCentered) - Use this static method if you want to center a component over another
component.
|
static void | centerComponentInWindow(Component component) - Use this static method if you want to center a component in Window.
|
static void | centerComponentInWindow(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.
|
centerComponentInComponent
public static void centerComponentInComponent(Component parent,
Component toBeCentered)
Use this static method if you want to center a component over another
component.
parent
- the component you want to use to place it ontoBeCentered
- the component you want to center
centerComponentInWindow
public static void centerComponentInWindow(Component component)
Use this static method if you want to center a component in Window.
component
- the component you want to center in window
centerComponentInWindow
public static void centerComponentInWindow(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. Valid percent is
between +-(0-100) minus is treated as plus, bigger than 100 is always set
to 100.
component
- the component you want to center and set size onpercentOfScreen
- the percent of the current screensize you want the component
to be
Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.