swt shell的一个问题 我想让我的shell不能被别人改变大小,该如何设置啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 new Shell(parent, style);第二个参数SWT.NONE就可以了。 用SWT.NONE不好啊 ,这样窗口就太难看了 swt 不是很熟悉,不知道有没有类似与swing的setResizable方法,楼主可以查下api要是有的话,就可以了,没的话还是在api中找答案吧。 new Shell(SWT.CLOSE);只带CLOSE按钮的Shell就可以! setShellStyle(SWT.MODELESS | SWT.DIALOG_TRIM | getDefaultOrientation()); 我给你写了个这个就是,然后红字的就是要设置窗口不被改变大小的import org.eclipse.swt.SWT;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;public class shell extends Shell { public static void main(String args[]) { try { Display display = Display.getDefault(); shell shell = new shell(display, SWT.MIN); shell.open(); shell.layout(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } catch (Exception e) { e.printStackTrace(); } } public shell(Display display, int style) { super(display, style); createContents(); } protected void createContents() { setText("SWT Application"); setSize(500, 375); } @Override protected void checkSubclass() { // Disable the check that prevents subclassing of SWT components }} 为什么 用gb2312写入英文字符“abcdef”用utf-8能够正确读出来?写入中文就读不出来了。原理是什么? 急等jxl包 帮忙看一段Java生成彩色验证码的程序把 关于Set接口 招聘.net winform开发人员 玩转JEditorPane的高手进来帮下忙...... 能给我介绍一下gsm格式的音频吗? 客户用浏览器,怎么样在服务器得到客户的IP?急,在线等,谢谢 300分!求教!! 寻找jdk ADPCM算法(音频编码) 关于继承Object类的一个问题
要是有的话,就可以了,没的话还是在api中找答案吧。
只带CLOSE按钮的Shell就可以!
这个就是,然后红字的就是要设置窗口不被改变大小的
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class shell extends Shell {
public static void main(String args[]) {
try {
Display display = Display.getDefault();
shell shell = new shell(display, SWT.MIN);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
} catch (Exception e) {
e.printStackTrace();
}
} public shell(Display display, int style) {
super(display, style);
createContents();
} protected void createContents() {
setText("SWT Application");
setSize(500, 375);
} @Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}}