📄 fontdialog.java
字号:
package edu.odu.cs.zeil.AlgAE.Client;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import edu.odu.cs.zeil.AlgAE.Client.FontSizeWidget;public class FontDialog extends Dialog implements ActionListener{ private int oldFontSize; private int fontSize; private FontSizeWidget fontWidget; private Button ok; private Button cancel; FontDialog (Frame theParent, int theOldFontSize) { super (theParent, "Font Size", true); fontSize = oldFontSize = theOldFontSize; fontWidget = new FontSizeWidget (fontSize, this); add ("Center", fontWidget); Panel p = new Panel(); add ("South", p); Button ok = new Button ("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); }}); Button cancel = new Button ("Cancel"); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fontSize = oldFontSize; dispose(); }}); p.add (ok); p.add (cancel); pack(); } public void actionPerformed(ActionEvent e) { fontSize = fontWidget.getValue(); } public int getFontSize() { show(); return fontSize; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -