package com.hsbc.automation;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Test {
protected Shell shell;
/**
* Launch the application.
* @param args
*/
public static void main(String[] args) {
try {
Test window = new Test();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Open the window.
*/
public void open() {
Display display = Display.getDefault();
createContents();
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
/**
* Create contents of the window.
*/
protected void createContents() {
shell = new Shell();
shell.setSize(606, 372);
shell.setText("SWT Application");
Composite comp = new Composite(shell, SWT.EMBE
SWT JTextPane 中文以及ASCII以外的字颜色高亮
最新推荐文章于 2021-05-12 19:34:39 发布
本文详细介绍了如何在SWT中使用JTextPane组件,实现中文和其他非ASCII字符的高亮显示,包括设置字体颜色、背景色等技术要点。
摘要由CSDN通过智能技术生成