/*
 * Created by JFormDesigner on Mon Apr 28 16:01:14 CST 2025
 */

package cn.vscoder.experiment_4;

import java.awt.*;
import javax.swing.*;

/**
 * @author xulongjin
 */
public class RegisterGUI {
    public RegisterGUI() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        title = new JFrame();
        panel1 = new JPanel();
        label1 = new JLabel();
        tfaccount = new JTextField();
        panel2 = new JPanel();
        label2 = new JLabel();
        passwordField1 = new JPasswordField();
        panel3 = new JPanel();
        button1 = new JButton();
        button2 = new JButton();

        //======== title ========
        {
            title.setTitle("\u6ce8\u518c\u767b\u5f55");
            var titleContentPane = title.getContentPane();
            titleContentPane.setLayout(new GridLayout(3, 1));

            //======== panel1 ========
            {
                panel1.setLayout(null);

                //---- label1 ----
                label1.setText("\u8d26\u6237\uff1a");
                panel1.add(label1);
                label1.setBounds(95, 45, 40, 30);
                panel1.add(tfaccount);
                tfaccount.setBounds(140, 40, 255, tfaccount.getPreferredSize().height);

                {
                    // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for(int i = 0; i < panel1.getComponentCount(); i++) {
                        Rectangle bounds = panel1.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panel1.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panel1.setMinimumSize(preferredSize);
                    panel1.setPreferredSize(preferredSize);
                }
            }
            titleContentPane.add(panel1);

            //======== panel2 ========
            {
                panel2.setLayout(null);

                //---- label2 ----
                label2.setText("\u5bc6\u7801\uff1a");
                panel2.add(label2);
                label2.setBounds(95, 35, 40, 30);
                panel2.add(passwordField1);
                passwordField1.setBounds(140, 30, 255, passwordField1.getPreferredSize().height);

                {
                    // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for(int i = 0; i < panel2.getComponentCount(); i++) {
                        Rectangle bounds = panel2.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panel2.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panel2.setMinimumSize(preferredSize);
                    panel2.setPreferredSize(preferredSize);
                }
            }
            titleContentPane.add(panel2);

            //======== panel3 ========
            {
                panel3.setLayout(null);

                //---- button1 ----
                button1.setText("\u767b\u5f55");
                panel3.add(button1);
                button1.setBounds(new Rectangle(new Point(270, 25), button1.getPreferredSize()));

                //---- button2 ----
                button2.setText("\u6ce8\u518c");
                panel3.add(button2);
                button2.setBounds(135, 25, 78, 34);

                {
                    // compute preferred size
                    Dimension preferredSize = new Dimension();
                    for(int i = 0; i < panel3.getComponentCount(); i++) {
                        Rectangle bounds = panel3.getComponent(i).getBounds();
                        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                    }
                    Insets insets = panel3.getInsets();
                    preferredSize.width += insets.right;
                    preferredSize.height += insets.bottom;
                    panel3.setMinimumSize(preferredSize);
                    panel3.setPreferredSize(preferredSize);
                }
            }
            titleContentPane.add(panel3);
            title.pack();
            title.setLocationRelativeTo(title.getOwner());
        }
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JFrame title;
    private JPanel panel1;
    private JLabel label1;
    private JTextField tfaccount;
    private JPanel panel2;
    private JLabel label2;
    private JPasswordField passwordField1;
    private JPanel panel3;
    private JButton button1;
    private JButton button2;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
