经讨论后认为较完善

pull/5/head
chen 4 months ago
parent e11185ad2c
commit 38b18833b2

@ -1,7 +1,7 @@
package view;
import controller.NavigationController;
import controller.NavigationService; // 新增导入
import controller.NavigationService;
import controller.QuestionController;
import model.Question;
@ -25,7 +25,7 @@ import java.awt.event.ItemListener;
public class ExamView extends JFrame {
private QuestionController questionController;
private NavigationService navigationService; // 新增
private NavigationService navigationService;
private JLabel questionLabel;
private JLabel progressLabel;
private ButtonGroup optionGroup;
@ -37,7 +37,7 @@ public class ExamView extends JFrame {
public ExamView() {
questionController = new QuestionController();
navigationService = NavigationController.getInstance(); // 新增
navigationService = NavigationController.getInstance();
initializeUI();
}

@ -1,7 +1,7 @@
package view;
import controller.NavigationController;
import controller.NavigationService; // 新增导入
import controller.NavigationService;
import controller.UserController;
import model.User;
@ -24,11 +24,11 @@ public class MainView extends JFrame {
private JComboBox<String> difficultyComboBox;
private JTextField countField;
private User currentUser; // 保存当前登录用户
private NavigationService navigationService; // 新增
private NavigationService navigationService;
public MainView(User user) {
this.currentUser = user;
this.navigationService = NavigationController.getInstance(); // 新增
this.navigationService = NavigationController.getInstance();
initializeUI();
}
@ -73,7 +73,7 @@ public class MainView extends JFrame {
mainPanel.add(formPanel, BorderLayout.CENTER);
// Button panel - 添加修改密码按钮
JPanel buttonPanel = new JPanel(new FlowLayout());
JButton changePasswordButton = new JButton("修改密码");
JButton logoutButton = new JButton("退出登录");

@ -1,7 +1,7 @@
package view;
import controller.NavigationController;
import controller.NavigationService; // 新增导入
import controller.NavigationService;
import controller.UserController;
import model.User;
@ -21,7 +21,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class RegisterView extends JFrame {
private JTextField usernameField; // 新增:用户名输入框
private JTextField usernameField; // 用户名输入框
private JTextField emailField;
private JTextField codeField;
private JPasswordField passwordField;
@ -39,7 +39,7 @@ public class RegisterView extends JFrame {
private void initializeUI() {
setTitle("数学学习软件 - 注册");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(550, 500); // 增加高度以容纳用户名字段
setSize(550, 500);
setLocationRelativeTo(null);
setResizable(false);

@ -1,7 +1,7 @@
package view;
import controller.NavigationController;
import controller.NavigationService; // 新增导入
import controller.NavigationService;
import javax.swing.JFrame;
import javax.swing.JPanel;
@ -18,7 +18,7 @@ import java.awt.event.ActionListener;
public class ResultView extends JFrame {
private JLabel scoreLabel;
private JLabel percentageLabel;
private NavigationService navigationService; // 新增
private NavigationService navigationService;
public ResultView() {
navigationService = NavigationController.getInstance(); // 新增

Loading…
Cancel
Save