Container control JPanel use __ to a cup of Java

Source: Internet
Author: User

-----------------siwuxie095

Project Name: Testui

Package Name: Com.siwuxie095.ui

Class Name: Testpanel.java

The catalogue of engineering structure is as follows:


After the default form JFrame is created, it contains a ContentPane

In Source, the definition of ContentPane is a JPanel type

Javax.swing.JPanel class is inherited from Javax.swing.JComponent class

And the Javax.swing.JComponent class inherits from the Java.awt.Container class

Container is a container, that is, JPanel is also a container

(JComponent nature is also a container)

A container can contain other containers, or a single control (component)

In general, a JPanel class is often used to host other controls, and its main role

is to provide space for other controls as support, and to set their background color in properties

For each jpanel there is a layout option Layout, the root panel

The ContentPane layout defaults to Java.awt.BorderLayout

In addition to JPanel, in the design of the Container also contains other containers,

Their functions are similar to those of JPanel, but they provide different characteristics respectively.

"Made by siwuxie095"

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.