📄 configview.java
字号:
package com.deskManager.window.contr;import com.deskManager.contr.DeskManager;import com.deskManager.contr.Time;import com.deskManager.File.ConfigOperationString;import java.awt.Dimension;import java.awt.FlowLayout;import java.awt.Toolkit;import java.awt.event.*;import javax.swing.*;public class ConfigView extends JDialog implements ActionListener { /** * */ private static final long serialVersionUID = 1L; private JSlider time = new JSlider(); private JButton ok = new JButton("确定"); private JButton cannel = new JButton("取消"); public ConfigView(JFrame p) throws Exception { super(p, true); this.setTitle("设置"); this.setLayout(new FlowLayout()); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.setSize(320, 200); this.add(new JLabel("双击时间")); this.add(new JLabel("快")); time.setMaximum(1000); time.setValue(new ConfigOperationString().getDoubleChick()); this.add(time); this.add(new JLabel("慢")); this.add(ok); this.add(cannel); ok.addActionListener(this); cannel.addActionListener(this); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((screenSize.width - this.getSize().width) / 2, (screenSize.height - this.getSize().height) / 2); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == ok) { int doubleClick = time.getValue(); Time.time = doubleClick; DeskManager.config.setDoublechick(doubleClick); try { new com.deskManager.File.ConfigOperationString().SaveOrUpdate(DeskManager.config); } catch (Exception e1) { e1.printStackTrace(); } this.dispose(); } else if (e.getSource() == cannel) { this.dispose(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -