欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

SWT(JFace)Group(分組顯示)

 更新時間:2009年06月25日 11:49:50   作者:  
SWT(JFace)體驗之Group(分組顯示)
演示代碼:
復制代碼 代碼如下:

package swt_jface.demo9;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
public class GroupExamples {

Display display = new Display();
Shell shell = new Shell(display);
public GroupExamples() {

Group group0 = new Group(shell, SWT.NULL);
group0.setLayout(new FillLayout());
Label label = new Label(group0, SWT.NULL);
label.setAlignment(SWT.CENTER);
label.setText("a group without title.");

Group group1 = new Group(shell, SWT.NULL);
group1.setText("SWT.NULL");

Group group2 = new Group(shell, SWT.SHADOW_ETCHED_IN);
group2.setText("SWT.SHADOW_ETCHED_IN");
Group group3 = new Group(shell, SWT.SHADOW_ETCHED_OUT);
group3.setText("SWT.SHADOW_ETCHED_OUT");

Group group4 = new Group(shell, SWT.SHADOW_IN);
group4.setText("SWT.SHADOW_IN");

Group group5 = new Group(shell, SWT.SHADOW_OUT);
group5.setText("SWT.SHADOW_OUT");

Group[] groups = new Group[]{group0, group1, group2, group3, group4, group5};

for(int i=0; i<groups.length; i++) {
groups[i].setBounds(10, 10 + i * 50, 300, 40);
}
shell.pack();
shell.open();

while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
public static void main(String[] args) {
new GroupExamples();
}
}
package swt_jface.demo9;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
public class GroupExamples {

    Display display = new Display();
    Shell shell = new Shell(display);
    public GroupExamples() {

        Group group0 = new Group(shell, SWT.NULL);
        group0.setLayout(new FillLayout());
        Label label = new Label(group0, SWT.NULL);
        label.setAlignment(SWT.CENTER);
        label.setText("a group without title.");

        Group group1 = new Group(shell, SWT.NULL);
        group1.setText("SWT.NULL");

        Group group2 = new Group(shell, SWT.SHADOW_ETCHED_IN);
        group2.setText("SWT.SHADOW_ETCHED_IN");    
        Group group3 = new Group(shell, SWT.SHADOW_ETCHED_OUT);
        group3.setText("SWT.SHADOW_ETCHED_OUT");        

        Group group4 = new Group(shell, SWT.SHADOW_IN);
        group4.setText("SWT.SHADOW_IN");    

        Group group5 = new Group(shell, SWT.SHADOW_OUT);
        group5.setText("SWT.SHADOW_OUT");

        Group[] groups = new Group[]{group0, group1, group2, group3, group4, group5};

        for(int i=0; i<groups.length; i++) {
            groups[i].setBounds(10, 10 + i * 50, 300, 40);
        }
        shell.pack();
        shell.open();

        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
        display.dispose();
    }
    public static void main(String[] args) {
        new GroupExamples();
    }
}

再看一個例子:

復制代碼 代碼如下:

package swt_jface.demo9;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class BugReport {

Display display = new Display();
Shell shell = new Shell(display);
public BugReport() {

shell.setLayout(new GridLayout(1, true));
shell.setImage(new Image(display, "C:/icons/bug.gif"));
shell.setText("Bug report page");

Group groupBug = new Group(shell, SWT.NULL);
groupBug.setText("Bug details");
groupBug.setLayout(new GridLayout(2, false));
groupBug.setLayoutData(new GridData(GridData.FILL_BOTH));

new Label(groupBug, SWT.NULL).setText("Priority");
Combo combo = new Combo(groupBug, SWT.BORDER);
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

new Label(groupBug, SWT.NULL).setText("Details");
Text text = new Text(groupBug, SWT.BORDER | SWT.MULTI);
text.setLayoutData(new GridData(GridData.FILL_BOTH));

Group groupProxy = new Group(shell, SWT.NULL);
groupProxy.setText("Connection setting");
groupProxy.setLayout(new GridLayout(2, false));
groupProxy.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

new Label(groupProxy, SWT.NULL).setText("Proxy host");
Text textHost = new Text(groupProxy, SWT.SINGLE | SWT.BORDER);
textHost.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
new Label(groupProxy, SWT.NULL).setText("Proxy port");
Text textPort = new Text(groupProxy, SWT.SINGLE | SWT.BORDER);
textPort.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

Button button = new Button(shell, SWT.PUSH);
button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
//button.setAlignment(SWT.CENTER);
button.setText("Submit bug report");
shell.pack();
shell.open();

while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
public static void main(String[] args) {
new BugReport();
}
}

相關(guān)文章

  • 新手小白學JAVA 日期類Date SimpleDateFormat Calendar(入門)

    新手小白學JAVA 日期類Date SimpleDateFormat Calendar(入門)

    本文主要介紹了JAVA 日期類Date SimpleDateFormat Calendar,文中通過示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-10-10
  • shardingJdbc3.x?版本的分頁bug問題解析

    shardingJdbc3.x?版本的分頁bug問題解析

    這篇文章主要為大家介紹了shardingJdbc3.x?版本的分頁問題解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-06-06
  • SpringBoot如何讀取xml配置bean(@ImportResource)

    SpringBoot如何讀取xml配置bean(@ImportResource)

    這篇文章主要介紹了SpringBoot如何讀取xml配置bean(@ImportResource),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-01-01
  • 關(guān)于mybatis3中@SelectProvider的使用問題

    關(guān)于mybatis3中@SelectProvider的使用問題

    這篇文章主要介紹了mybatis3中@SelectProvider的使用技巧,@SelectProvide指定一個Class及其方法,并且通過調(diào)用Class上的這個方法來獲得sql語句,本文通過實例代碼給大家介紹的非常詳細,需要的朋友可以參考下
    2021-12-12
  • 詳解JDK自帶javap命令反編譯class文件和Jad反編譯class文件(推薦使用jad)

    詳解JDK自帶javap命令反編譯class文件和Jad反編譯class文件(推薦使用jad)

    這篇文章主要介紹了JDK自帶javap命令反編譯class文件和Jad反編譯class文件(推薦使用jad),本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-09-09
  • java 一鍵部署 jar 包和 war 包

    java 一鍵部署 jar 包和 war 包

    這篇文章主要介紹了Java創(chuàng)建打包命令、創(chuàng)建啟動文件等功能實現(xiàn)Java一鍵部署 jar 包和 war 包,感興趣的下伙伴可以參考下文
    2021-09-09
  • Java-JFrame-swing嵌套瀏覽器的具體步驟

    Java-JFrame-swing嵌套瀏覽器的具體步驟

    下面小編就為大家?guī)硪黄狫ava-JFrame-swing嵌套瀏覽器的具體步驟。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-10-10
  • ThreadLocal的內(nèi)存泄露問題

    ThreadLocal的內(nèi)存泄露問題

    這篇文章主要介紹了Java中ThreadLocal的內(nèi)存泄露問題,以及為什么會出現(xiàn)內(nèi)存泄漏,感興趣的小伙伴可以參考閱讀
    2023-03-03
  • SpringBoot中@RequestBody不能和Multipart同時傳遞的問題解決

    SpringBoot中@RequestBody不能和Multipart同時傳遞的問題解決

    本文主要介紹了SpringBoot中@RequestBody不能和Multipart同時傳遞的問題解決,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2023-04-04
  • 在springboot中使用注解將值注入?yún)?shù)的操作

    在springboot中使用注解將值注入?yún)?shù)的操作

    這篇文章主要介紹了在springboot中使用注解將值注入?yún)?shù)的操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-04-04

最新評論