编程知识 cdmana.com

Java basic course writing QQ login page

    1. Java To write QQ The login page -- Pay Extension Education
      1. Chapter one :GUI Introduction to
        1. 1. summary

GUI:Graphical User Interface, abbreviation GUI. Translate to gui , Also known as the graphical user interface , It refers to the graphical display of the user interface of computer operation .

Java Language is not particularly good at developing graphical interfaces ,c++ More suitable for the development of graphical interface .Java It is suitable for the development of server-side programs .

Java do GUI Programming for 2 A package ,java.awt and javax.swing.

awt: Abstract window toolkit , You need to call the method in the local system to implement the function . Belongs to heavyweight control .

swing: stay awt On the basis of , Set up a set of graphic interface system ,swing More components are available in , And completely by java To achieve , Enhanced portability , It's a lightweight control .

The class structure diagram is as follows :

  1. 2. GUI Layout

After creating a window , You can't add text directly to the window 、 Pictures and other messages . The right way to do this is to create the corresponding component , For example, create JLabel Components , Set up the content , And then JLabel Component added to the window . This requires the layout of the container , There are many ways to layout , The common layout is as follows :

FlowLayout: Fluid layout , yes Panel( And its subclasses ) Type container's default layout manager type . Layout effect : Components are positioned in the container line by line in the order of addition , Inside the line, from left to right , Line after line . Components are displayed in their original size .

BorderLayout: Boundary layout , yes Window Default layout manager for container of its subclass type . Layout effect : Divide the entire container range into East、West、South、North、Center Five areas , Components can only be added to the specified area . In containers that use boundary layout , The size of components is also controlled by the layout manager , That is, the same size as its area .

GridLayout: Grid layout , Layout effect : Divide the container area into regular rectangular grids , Each cell range is the same size . Components are added to each cell , First fill a line from left to right according to the order of adding components, and then wrap , Between the lines, from top to bottom .

Absolute position layout : For location layout, you don't use any layout manager , Put the component in a fixed position . This method is not recommended under normal circumstances , In this way, the location and size of the components do not automatically fit , When the container size changes , The display effect of components may not be ideal .

GridBagLayout: Grid group layout manager . More flexible layout .

  1. Chapter two :GUI How to get started with

     

    1. 1. GUI How to get started with

      1. The third chapter : Event monitoring
        1. 1. The concept of event monitoring

Event source : The component that generates the event is an event source .

event : When the user performs an operation on the interface , For example, press the keyboard 、 When you drag or click the mouse , Will produce an event .

Monitor : It's the object that calls the event handler .

How events are handled : When an event occurs , The way the listener executes processing time .

        1. 2. Event monitoring code program
  1. 3. Common event listeners

Keyboard event listener

Mouse event listener

  1. Chapter four :GUI Small exercise
    1. 1. simulation QQ Login page exercise

demand : Use GUI Technology drawing QQ The login page .

 

 

 

Based on my many years of working experience and learning experience , Recorded a new set of Java Focus on video tutorials , If you are learning now Java, At the beginning of learning Java There is no systematic learning course in the process , You can add groups 654631948 Collect the learning materials , Interview questions , Development tools, etc , There are senior people in the group java The teacher answers questions , Every day, there will also be live lectures on the basic part and architecture , You can also add my wechat renlliang2013 In depth communication , As long as I really want to learn Java People welcome .

 

java Basic course :https://ke.qq.com/course/149432?tuin=57912c43

Java Distributed Internet Architecture / Microservices / High performance /springboot/springcloud:

https://ke.qq.com/course/179440?tuin=57912c43

 

版权声明
本文为[renlianggee]所创,转载请带上原文链接,感谢

Scroll to Top