Chinaunix

标题: 求助:eclipse插件开发中,怎么显示大量文字啊? [打印本页]

作者: Hooraykxld    时间: 2012-07-18 16:17
标题: 求助:eclipse插件开发中,怎么显示大量文字啊?
我用的是SWT中的Label或Text等,最多显示1000多字,再多了程序就死了


我的代码:
org.eclipse.swt.widgets.Text fText = getWidgetFactory().createText(parent,
                                      “”,
                                      SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);

                int style = GridData.FILL_HORIZONTAL;
                gd = new GridData(style);
                gd.widthHint = 50;
                fText.setLayoutData(gd);

                fText.setText(text); //text长度为8000

作者: isaacxu    时间: 2012-07-18 22:29
也许可以考虑使用StyledText,具体参见SWT的例子org.eclipse.swt.examples.javaviewer 。如果要可编辑参见org.eclipse.swt.examples.texteditor




作者: dyllove98    时间: 2012-07-23 19:02
1000个汉字程序就死机?你是不是需要升级版本了..




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2