急!如何在jface的自定义对话框中设置标题 以为setText()可以解决 谁知继承自jface的dialog没有这个方法 哎 各位用过的说说怎么设置哈 不胜感激 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 LZ参考一下下面的代码:import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; public class PurposeConfiger extends Dialog { private Shell shell = null; private Text text = null; /**** 其实我是想让这个文本框显示多行 ****/ public PurposeConfiger(Shell parentShell) { super(parentShell); } protected Control createDialogArea(Composite parent) { Shell shell = this.getShell(); shell.setText("配置[用途]预制信息"); shell.setStze(300,300); /*** 次语句后的所有要添加的组件都不添加了 ****// GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 1; gridLayout.horizontalSpacing = 10; gridLayout.marginHeight = 5; gridLayout.marginWidth = 5; gridLayout.makeColumnsEqualWidth = true; parent.setLayout(gridLayout); { Label inf = new Label(parent, SWT.NONE); inf.setText("预制用途信息,每行一个"); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = 1; inf.setLayoutData(gridData); } { Text text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); gridData.horizontalSpan = 1; gridData.verticalSpan = 5; text.setLayoutData(gridData); } return parent; } protected int getShellStyle() { return super.getShellStyle() | SWT.RESIZE; } } 寻技术上的解决方案 请教反省问题 如何通过实践学习java? 谈谈Thinking in java 和 java 核心技术哪本好??? (在线)querydataset打开失败! 创建一个类StaticDemo,要求不使用main函数就能打印出一句"Hello World" 初学者的一个关于【JAR】的问题,不吝赐教..... multipart/form-data上传方式,提交数据的问题。 关于Color类的一个问题 引用类的问题。 全部分请教:何使用“tomcat的webdav”? 请教--- java主线程如何等待其他线程结束
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
public class PurposeConfiger extends Dialog {
private Shell shell = null;
private Text text = null; /**** 其实我是想让这个文本框显示多行 ****/
public PurposeConfiger(Shell parentShell) {
super(parentShell);
}
protected Control createDialogArea(Composite parent) {
Shell shell = this.getShell();
shell.setText("配置[用途]预制信息");
shell.setStze(300,300); /*** 次语句后的所有要添加的组件都不添加了 ****//
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
gridLayout.horizontalSpacing = 10;
gridLayout.marginHeight = 5;
gridLayout.marginWidth = 5;
gridLayout.makeColumnsEqualWidth = true;
parent.setLayout(gridLayout);
{
Label inf = new Label(parent, SWT.NONE);
inf.setText("预制用途信息,每行一个");
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
inf.setLayoutData(gridData);
}
{
Text text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL
| GridData.FILL_VERTICAL);
gridData.horizontalSpan = 1;
gridData.verticalSpan = 5;
text.setLayoutData(gridData);
}
return parent;
}
protected int getShellStyle() {
return super.getShellStyle() | SWT.RESIZE;
}
}