Javaoo 14 16 Chapters

Source: Internet
Author: User

Multithreaded programming

There are two types of multitask processing

Process-based features: Allows the computer to run two or more programs at the same time

Threads are the smallest processing unit in a thread-based multi-task processing environment

Process refers to a "self-containment" of the running program, with its own address space

Less overhead required for thread-based

In multitasking, individual processes need to allocate their own separate address space

Multiple threads can share the same address space and share the same process together

How to create a thread: 1. Write a class that inherits the thread class, and then override the run () method of the thread class in the class

2. Write a class to implement the Runnable interface, and then associate an instance of the class with the Java.lang.Thread object

Priority: Minimum 1 up to 10 default 5

Java Graphical interface programming

Peers is a local GUI component that is manipulated by AWT peers is invisible to program developers

Weight component: AWT: Coarse, unsightly

Platform inconsistency, "one-time programming, debugging Everywhere"

A program that is less efficient and unsuitable for complex interfaces

Development speed is relatively fast

Lightweight components: Swing: A richer, more convenient collection of user interface elements

Less reliance on the underlying platform and fewer bugs on the platform

A consistent feeling for users on different platforms

Swing components are mostly lightweight components with no peer components

Swing does not replace AWT completely

Component three elements: 1. Content 2. Appearance display 3. Behavior

Swing uses MVC (model-view-control) Design Patterns

The basic idea of MVC divides a GVI component into three parts:

Model section-Store content

View section-Show content

Control section-handling user events

Boderlayout: Divided into 5 districts,

Javaoo 14 16 Chapters

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.