Java Implementation Chat System project notes

Source: Internet
Author: User

After Javase learning, the Java-implemented chat room blends a lot of Java knowledge.

such as GUI simple graphical interface, collection, IO, multi-threading, socket, monitoring and so on.

So how is this chat system implemented?

First we have to have the interface.

This is just a simple frame window interface.

First Package: Packet entry, equivalent to the absolute path of this class of files, and others repeat the chance to reduce

Import: The meaning of the imported package/class. When you want to invoke the method of a class in a package, use the Import

EXTENDS:CHATCLIENT01 inherits the frame, which is equivalent to inheriting all the methods inside the parent class frame.

In the following code, declare the variables to be used next, the variable declaration three steps: Specify the data type, specify the variable name, assign the value

Main: The entry of the program

Instantiate ChatClient01 and then call Launchframe () inside the method and implement it.

This: Refers to the current object.

Pack (): Call the Pack () method, which sets the size of the window to fit all of the components you place

SetVisible (): Sets the visual window to be visible.

Window is implemented, the next step is to implement some response to the window.

Java Implementation Chat System project notes

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.