This is the 28th day of my participation in the Gwen Challenge in November. Check out the details: The last Gwen Challenge in 2021.”

Preface:

The project is developed using Java Swing +mysql, which can realize basic data maintenance, user login and registration, community information list view, community information addition, community information modification, community information deletion and logout and other functions. The interface design is relatively simple and easy to learn, suitable for Java class design and learning technology.

The introduction

With the rapid development of global information technology, the efficient scale continues to grow, and the number of associations increases rapidly, it is necessary to develop a student association management system to improve the management efficiency of associations, student association management system will gradually replace the traditional manual management mode. This paper uses Java+ Swing +mysql as the development technology, Java as the programming language, the development of a student community management system based on javaSwing. The system can carry on the rapid and efficient management of the association work, provide a good information exchange platform between the association and the association members, so that the association members can show their elegant demeanour, timely understand the new dynamics of the association, and create a modern learning and living environment.

Main technologies and tools:

eclipse+JDK1.. 8+Navicat database visualization tools + Swing +mysql

Function screenshots:

User login registration:

The user enters the account password to log in, and the unregistered user clicks the registration button to register the user information. After registration, the user can successfully log in to view the community information.

 

Club list view:

Club information added:

Input the relevant information of the club to complete the operation of adding the club

Club information modification:

Deletion of club information:

Logout exit:

Logout Exits the page closure operation.

Key code:

User login:

/** * Log in to the home screen *@author admin
 *
 */
public class LoginFrame extends JFrame {
	private static final long serialVersionUID = 1L;
	
	// Login background and Logo image color
	Color logoPaneColor = new Color(230.230.250);
	Color mainPaneColor = new Color(230.230.250);
	Color mainFrameColor = new Color(186.110.64);
	Color logoFramColor = new Color(186.110.64);
	
	JLayeredPane layeredPane = new JLayeredPane(); / / panel layer
	ImageIcon bgImage = new ImageIcon("./img/bgImage.png"); // Background image
	ImageIcon lgImage = new ImageIcon("./img/login1.png"); // Login image
	
	JPanel bgPanel = new JPanel(); // Background panel
	JPanel mainPanel = new JPanel(); // Login panel
	JPanel logoPanel = new JPanel(); / / corporate logo
	
	final JLabel user_name = new JLabel("Username :");   // Login tag
	final JLabel user_password = new JLabel("The secret code.");// Password label
	
	JButton button_ok = new JButton("Login"); // Confirm button
	JButton btRegister=new JButton("Registered"); // Register button
	JButton button_cansel = new JButton("Quit");// Exit button
	
	JTextField text_name = new JTextField(""); // Login user name
	JPasswordField text_password = new JPasswordField(""); // Login password
	JFrame loginFrame = null; // Login window class
	
	/** * click the listener class: collect login information and verify; If the verification succeeds, the system main page is displayed@author admin
	 *
	 */
	class LoginOKAction implements ActionListener {
		public void actionPerformed(ActionEvent e) {
			String userName = text_name.getText();
			String password = new String(text_password.getPassword());
			
			// call null
			if(userName.equals("") || password.equals("")) {
				// A message is displayed indicating that the operation is complete
				JOptionPane.showMessageDialog(loginFrame, "Login username and password cannot be empty!"."Tip", JOptionPane.PLAIN_MESSAGE);
				return;
			}
			
			// Query by user name and password
			boolean flag = UserManager.login(userName, password);
			
			// Verification failed
			if(! flag) { JOptionPane.showMessageDialog(loginFrame,"Login user name does not match!"."Tip", JOptionPane.PLAIN_MESSAGE);
				return;
			}
			
			// Successful, go to the home page
			setVisible(false);
			new MainFrame().setVisible(true); }}/** * Log into the Frame constructor */
	public LoginFrame(a) {
		super(Student Community Management System);
		initialize();
		this.loginFrame = this;
	}

	
	/** * the main function *@param args
	 */
	public static void main(String[] args) {
		// Create a login Frame to access the application login page
		newLoginFrame(); }}Copy the code

Add club information:


public class AddFrame extends AbstractFormFrame {
	private static final long serialVersionUID = 1L;
	/** * Main interface configuration */
    public AddFrame(a) {
        super("Add");
        / / in the middle
     	GUIUtil.toCenter(this);
    }

    @Override
    public void submit(CommunityInfo community) {
        / / the only
        CommunityInfo tmp = CommunityManager.queryOne(community.getName());
        if(tmp ! =null) {
            JOptionPane.showMessageDialog(this."Club name already exists!");
            return;
        }

        // Add to record list
        CommunityManager.add(community);

        / / hint
        JOptionPane.showMessageDialog(this."Added successfully!"); }}Copy the code

Note: the project comes from the network, the author arranges and optimizes the test, if has the infringement contact the author to delete

Conclusion:

Through the recent mastery and learning of Java related knowledge, such as object-oriented programming and Java Swing, I have learned more about the importance of Java learning. During the development of this community system, I completed many experiments and tests. In this stage of learning and development, I became familiar with it and then became able to use it independently. Through the knowledge of Java Swing and database design, I found that it does have a lot of convenience. It integrates abstractness, encapsulation, inheritance and polymorphism, realizes code reuse and code expansion, and improves the efficiency of software development. It is very important for our major to learn Java language well, so IN the process of developing this project, I tried my best to understand Java programming ideas, master basic skills and learn as much knowledge as possible. The basic purpose of my study of programming is to develop the key skills of describing programmatic solutions to practical problems. Generally speaking, Java object-oriented programming is a practical language.

Javascript project updates 3/100

Everyone can like, like, follow and comment on me now