用chatgpt写的个人记账管理系统,有源代码

 这是部分用chatgpt写的源码,有需要的可以联系

里面的图片可以敲掉

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

 public class Login extends JFrame implements ActionListener { private JLabel welcome = new JLabel("假面超级记账系统");
    private JLabel userLabel, passwordLabel, imageLabel;
    private JTextField usernameField; private JPasswordField passwordField;
    private JButton loginButton, registerButton; private CardLayout cardLayout = new CardLayout();
    private JPanel cardPanel, imagePanel;
    private Users users;

    public Login() {
        this.init();
    }

    private void init() {

        welcome.setFont(new Font("宋体", Font.PLAIN, 45));
        setTitle("假面记账管理系统");
        setLayout(new BorderLayout());
        userLabel = new JLabel("用户名");
        passwordLabel = new JLabel("密码");
        registerButton = new JButton("注册");
        cardPanel = new JPanel(cardLayout);
        imagePanel = new JPanel();

        ImageIcon imageIcon = new ImageIcon("D:\\Genshin Impact\\Genshin Impact Game\\ScreenShot\\2022121142631.png"); // 添加图片
        Image image = imageIcon.getImage().getScaledInstance(500, 400, java.awt.Image.SCALE_SMOOTH);
        imageIcon = new ImageIcon(image);
        imageLabel = new JLabel(imageIcon);

        JPanel panel1 = new JPanel(new BorderLayout());

        usernameField = new JTextField();
        passwordField = new JPasswordField();
        loginButton = new JButton("登录");
        loginButton.addActionListener(this);

        JPanel titlepanel = new JPanel(new FlowLayout());//标题面板
        JPanel loginpanel = new JPanel();//登录面板
        loginpanel.setLayout(null);


        welcome.setBounds(250, 100, 400, 40);
        userLabel.setBounds(340, 170, 50, 20);
        passwordLabel.setBounds(340, 210, 50, 20);
        usernameField.setBounds(390, 170, 120, 20);
        passwordField.setBounds(390, 210, 120, 20);
        loginButton.setBounds(340, 250, 80, 25);
        registerButton.setBounds(430, 250, 80, 25);
        imageLabel.setBounds(100, 130, 200, 200);

        loginpanel.add(welcome);
        loginpanel.add(userLabel);
        loginpanel.add(passwordLabel);
        loginpanel.add(usernameField);
        loginpanel.add(passwordField);
        loginpanel.add(loginButton);
        loginpanel.add(registerButton);
        imagePanel.add(imageLabel);

        panel1.add(titlepanel, BorderLayout.NORTH);
        panel1.add(loginpanel, BorderLayout.CENTER);
        panel1.add(imagePanel, BorderLayout.WEST);

        cardPanel.add(panel1, "登录");

        add(cardPanel);
        setBounds(100, 100, 700, 500);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        registerButton.addActionListener(new ActionListener() {        //为注册按钮添加监听事件
            public void actionPerformed(ActionEvent arg0) {

            }
        });
    }

人工写的,如有相同,联系删除

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值