📄 fontdialog1.java
字号:
/**
* @作者:陈刚
* @Email:glchengang@yeah.net
* @Blog:http://blog.csdn.net/glchengang
*/
package jface.dialog.other;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.FontDialog;
import org.eclipse.swt.widgets.Shell;
public class FontDialog1 {
public static void main(String[] args) {
final Shell shell = new Shell();
FontDialog dlg = new FontDialog(shell);
FontData fontData = dlg.open();
if (fontData != null) {
Font font = new Font(shell.getDisplay(), fontData);
// 使用字体对象font …… ……
// 一定要记得用完后,调用font.dispose()将font释放掉
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -