Package org.apache.jorphan.gui
Class ComponentUtil
java.lang.Object
org.apache.jorphan.gui.ComponentUtil
This class is a Util for awt Component and could be used to place them in
center of another.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcenterComponentInComponent(Component parent, Component toBeCentered) Use this static method if you want to center a component over another component.static voidcenterComponentInWindow(Component component) Use this static method if you want to center a component in Window.static voidcenterComponentInWindow(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.
-
Method Details
-
centerComponentInWindow
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.- Parameters:
component- the component you want to center and set size onpercentOfScreen- the percent of the current screen size you want the component to be
-
centerComponentInWindow
Use this static method if you want to center a component in Window.- Parameters:
component- the component you want to center in window
-
centerComponentInComponent
Use this static method if you want to center a component over another component.- Parameters:
parent- the component you want to use to place it ontoBeCentered- the component you want to center
-