SetLocationRelativeTo ()

Source: Internet
Author: User
The setLocationRelativeTo () usage in the JFrame class setLocationRelativeTo () is a method inherited from the java. awt. Window class. Its prototype is:
Public void setLocationRelativeTo (Component c );
Usage:
Set the position of the window relative to the specified component. If this component is not currently displayed, or CIs Null, The window is located in the center of the screen. If the bottom of the component is out of sight, the window is placed in ComponentThe closest side to the center of the window. Therefore, if ComponentIn the right part of the screen WindowIt will be placed on the left, and vice versa.

 

Parameters:
C-Determine the components involved in the window position

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.