The XML framework of library system based on swing

Source: Internet
Author: User

Brief introduction

Now, the market is tightening. Frameworks can save time in the design and development phases. The IDE makes it easier for us to develop user interfaces. Standard GUI applications that define GUIs with different panel layouts have become a fundamental pattern. Based on this model, consider using a framework to improve execution speed, achieve higher parallel processing, and coordinate more relaxed development approaches. We're going to use the Java Swing application here to describe such a framework.

Simple application-Library management system

Here we discuss a simple library management system to understand the Xml-based GUI framework.

The flowchart above defines the design of the library user interface. Home directory, member login, user registration and book search, these are the Panels (panel) that exist in the application. As you can see from the flowchart, there are several possible processing paths in your application:

Home directory-> user Registration-> Book Search

Home Directory-> Member login-> book Search

Principle

The panel displayed at any time depends on the output of the previous panel. Therefore, you need to design a generic controller as the form for the entire framework, which provides the panel with the necessary input and handles the output that the Panel expects to return. These panels implement the Xsfpanel interface, in which an execute () method is used to deposit the input from the form into a hashmap and return the output from another hashmap. The controller of the framework handles the output returned using HashMap and is ready to determine which panel should be displayed.

public interface XSFPanel extends JPanel
{
  public HashMap execute(HashMap inputs);
  . . .
}

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.