"Fundamentals of Java language Programming"--basic graphical user interface--some summary

Source: Internet
Author: User
12th. Graphical Interface Basics


1. is that class the root of the Java GUI component? is the container Class A subclass of component? Which class is the root of the swing GUI build?
Java.awt.component is the root of all Java GUI component classes.
A container class, such as JFrame, is a subclass of a component.
JComponent is the root of the Swing GUI component class.


2.AWT components different from swing build?
The components of AWT are heavy and swing components are lightweight.


3.
You can add a button to a frame.
Answer: Correct
You can add a frame to the panel.
Answer: Error
You can add a panel to a frame.
Answer: Correct
You can add any number of components to a panel, a frame, or a small program.
Answer: Correct
You can pass parameters from the Jpanel,jframe class, or from the.
Answer: Correct


The default layout manager for the framework is BorderLayout
The default layout manager for the panel is FlowLayout


GUI components such as JButton can only be added to a container and appear only once in one container. Adding multiple times is invalid.
Only icons and borders can be shared in GUI components, and buttons cannot be shared.

"Fundamentals of Java language Programming"--basic graphical user interface--some summary

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.