| | |
| | | import ui.UIConfig; |
| | | |
| | | import javax.swing.*; |
| | | |
| | | import publicway.buttonset; |
| | | |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | | |
| | |
| | | contentPanel.add(Box.createRigidArea(new Dimension(0, 10))); |
| | | } |
| | | |
| | | JButton addAreaBtn = new JButton("➕ 新增地块"); |
| | | addAreaBtn.setFont(new Font("微软雅黑", Font.BOLD, 14)); |
| | | addAreaBtn.setBackground(THEME_COLOR); |
| | | addAreaBtn.setForeground(Color.WHITE); |
| | | addAreaBtn.setBorder(BorderFactory.createEmptyBorder(15, 0, 15, 0)); |
| | | addAreaBtn.setFocusPainted(false); |
| | | JButton addAreaBtn = buttonset.createStyledButton("➕ 新增地块", THEME_COLOR); |
| | | addAreaBtn.setFont(new Font("微软雅黑", Font.BOLD, 14)); |
| | | addAreaBtn.setBorder(BorderFactory.createEmptyBorder(15, 0, 15, 0)); |
| | | addAreaBtn.setAlignmentX(Component.CENTER_ALIGNMENT); |
| | | |
| | | addAreaBtn.addActionListener(e -> { |
| | |
| | | } |
| | | |
| | | private JButton createAreaButton(String icon, String text) { |
| | | JButton button = new JButton("<html><center>" + icon + "<br>" + text + "</center></html>"); |
| | | JButton button = buttonset.createStyledButton("<html><center>" + icon + "<br>" + text + "</center></html>", Color.WHITE); |
| | | button.setFont(new Font("微软雅黑", Font.PLAIN, 14)); |
| | | button.setPreferredSize(new Dimension(250, 80)); |
| | | button.setBackground(Color.WHITE); |
| | | button.setForeground(new Color(80, 80, 80)); |
| | | button.setBorder(BorderFactory.createCompoundBorder( |
| | | BorderFactory.createLineBorder(new Color(200, 200, 200)), |
| | | BorderFactory.createEmptyBorder(10, 10, 10, 10) |
| | | )); |
| | | button.setFocusPainted(false); |
| | | |
| | | button.addMouseListener(new MouseAdapter() { |
| | | public void mouseEntered(MouseEvent e) { |