| | |
| | | JPanel manualBoundaryDrawingPanel = createManualBoundaryDrawingPanel(); |
| | | manualBoundaryDrawingModeLabel = (JLabel) manualBoundaryDrawingPanel.getClientProperty("valueLabel"); |
| | | |
| | | // 修改密码设置项 |
| | | JPanel changePasswordPanel = createChangePasswordPanel(); |
| | | |
| | | JPanel feedbackPanel = createFeedbackPanel(); |
| | | |
| | | // APP版本 |
| | |
| | | addSettingItem(panel, boundaryLengthPanel, true); |
| | | addSettingItem(panel, measurementModePanel, true); |
| | | addSettingItem(panel, manualBoundaryDrawingPanel, true); |
| | | addSettingItem(panel, changePasswordPanel, true); |
| | | addSettingItem(panel, feedbackPanel, true); |
| | | addSettingItem(panel, appVersionPanel, true); |
| | | addSettingItem(panel, logoutPanel, false); // 最后一项不加分割线 |
| | |
| | | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * 创建修改密码设置面板 |
| | | */ |
| | | private JPanel createChangePasswordPanel() { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | | panel.setOpaque(false); |
| | | panel.setAlignmentX(Component.LEFT_ALIGNMENT); |
| | | panel.setMaximumSize(new Dimension(Integer.MAX_VALUE, ROW_HEIGHT)); |
| | | panel.setPreferredSize(new Dimension(Integer.MAX_VALUE, ROW_HEIGHT)); |
| | | panel.setMinimumSize(new Dimension(0, ROW_HEIGHT)); |
| | | panel.setBorder(BorderFactory.createEmptyBorder(ITEM_PADDING, ITEM_PADDING, ITEM_PADDING, ITEM_PADDING)); |
| | | |
| | | GridBagConstraints gbc = new GridBagConstraints(); |
| | | |
| | | JLabel titleLabel = new JLabel("修改密码"); |
| | | titleLabel.setFont(new Font("微软雅黑", Font.BOLD, 14)); |
| | | titleLabel.setForeground(Color.BLACK); |
| | | titleLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
| | | gbc.gridx = 0; |
| | | gbc.gridy = 0; |
| | | gbc.weightx = 0; |
| | | gbc.anchor = GridBagConstraints.EAST; |
| | | gbc.insets = new Insets(0, 0, 0, 12); |
| | | panel.add(titleLabel, gbc); |
| | | |
| | | JLabel valueLabel = new JLabel("******"); |
| | | valueLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14)); |
| | | valueLabel.setForeground(Color.DARK_GRAY); |
| | | gbc = new GridBagConstraints(); |
| | | gbc.gridx = 1; |
| | | gbc.gridy = 0; |
| | | gbc.weightx = 1.0; |
| | | gbc.anchor = GridBagConstraints.EAST; |
| | | panel.add(valueLabel, gbc); |
| | | |
| | | JButton editBtn = createEditButton(); |
| | | editBtn.addActionListener(e -> { |
| | | SwingUtilities.invokeLater(() -> { |
| | | xiugaimima dialog = new xiugaimima((Frame) SwingUtilities.getWindowAncestor(this)); |
| | | dialog.setVisible(true); |
| | | }); |
| | | }); |
| | | |
| | | gbc = new GridBagConstraints(); |
| | | gbc.gridx = 2; |
| | | gbc.gridy = 0; |
| | | gbc.weightx = 0; |
| | | gbc.anchor = GridBagConstraints.EAST; |
| | | panel.add(editBtn, gbc); |
| | | |
| | | return panel; |
| | | } |
| | | } |