最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

SWT(JFace)體驗(yàn)之Sash(活動(dòng)控件)

 更新時(shí)間:2009年06月25日 11:52:05   作者:  
SWT(JFace)體驗(yàn)之Sash(活動(dòng)控件)
演示代碼如下:

復(fù)制代碼 代碼如下:

package swt_jface.demo9;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Sash;
import org.eclipse.swt.widgets.Shell;
public class SashExample {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
final Sash sash = new Sash(shell, SWT.BORDER | SWT.VERTICAL);
sash.setBounds(10, 10, 15, 60);
sash.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
System.out.println("Selected. ");
sash.setBounds(e.x, e.y, e.width, e.height);
}
});
shell.open();
sash.setFocus();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
package swt_jface.demo9;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Sash;
import org.eclipse.swt.widgets.Shell;
public class SashExample {
    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);
        final Sash sash = new Sash(shell, SWT.BORDER | SWT.VERTICAL);
        sash.setBounds(10, 10, 15, 60);
        sash.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event e) {
                System.out.println("Selected. ");
                sash.setBounds(e.x, e.y, e.width, e.height);
            }
        });
        shell.open();
        sash.setFocus();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
    }
}


再來一個(gè)例子:

復(fù)制代碼 代碼如下:

package swt_jface.demo9;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class SashFormExample {

Display display = new Display();
Shell shell = new Shell(display);

SashForm sashForm;
SashForm sashForm2;
public SashFormExample() {

shell.setLayout(new FillLayout());

sashForm = new SashForm(shell, SWT.HORIZONTAL);
Text text1 = new Text(sashForm, SWT.CENTER);
text1.setText("Text in pane #1");
Text text2 = new Text(sashForm, SWT.CENTER);
text2.setText("Text in pane #2");

sashForm2 = new SashForm(sashForm, SWT.VERTICAL);
final Label labelA = new Label(sashForm2, SWT.BORDER | SWT.CENTER);
labelA.setText("Label in pane A");
final Label labelB = new Label(sashForm2, SWT.BORDER |SWT.CENTER);
labelB.setText("Label in pane B");

text1.addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
}
public void controlResized(ControlEvent e) {
System.out.println("Resized");
//ArrayUtil.printArray(sashForm.getWeights(), System.out);
}
});

sashForm.setWeights(new int[]{1, 2, 3});

labelA.addMouseListener(new MouseListener() {
public void mouseDoubleClick(MouseEvent e) {
if(sashForm2.getMaximizedControl() == labelA)
sashForm2.setMaximizedControl(null);
else
sashForm2.setMaximizedControl(labelA);
}
public void mouseDown(MouseEvent e) {
}
public void mouseUp(MouseEvent e) {
}
});


shell.setSize(450, 200);
shell.open();

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

相關(guān)文章

  • Json 自定義使用函數(shù)的簡單實(shí)例

    Json 自定義使用函數(shù)的簡單實(shí)例

    下面小編就為大家?guī)硪黄狫son 自定義使用函數(shù)的簡單實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-10-10
  • 詳解Java對(duì)象序列化為什么要使用SerialversionUID

    詳解Java對(duì)象序列化為什么要使用SerialversionUID

    這篇文章主要介紹了詳解Java對(duì)象序列化為什么要使用SerialversionUID,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-11-11
  • FastJSON字段智能匹配踩坑的解決

    FastJSON字段智能匹配踩坑的解決

    這篇文章主要介紹了FastJSON字段智能匹配踩坑的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2021-06-06
  • springAOP完整實(shí)現(xiàn)過程

    springAOP完整實(shí)現(xiàn)過程

    當(dāng)你調(diào)用SimpleService類的doSomething方法時(shí),上述的PerformanceAspect會(huì)自動(dòng)攔截此調(diào)用,并且記錄該方法的執(zhí)行時(shí)間,這樣你就完成了一個(gè)針對(duì)Spring的AOP入門級(jí)案例,感興趣的朋友一起看看吧
    2024-02-02
  • Maven中dependency和plugins的繼承與約束

    Maven中dependency和plugins的繼承與約束

    這篇文章主要介紹了Maven中dependency和plugins的繼承與約束,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-12-12
  • MyBatisPlus+Spring實(shí)現(xiàn)聲明式事務(wù)的方法實(shí)現(xiàn)

    MyBatisPlus+Spring實(shí)現(xiàn)聲明式事務(wù)的方法實(shí)現(xiàn)

    本文主要介紹了MyBatisPlus+Spring實(shí)現(xiàn)聲明式事務(wù)的方法實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-07-07
  • 輕松掌握java中介者模式

    輕松掌握java中介者模式

    這篇文章主要幫助大家輕松掌握java中介者模式,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-09-09
  • springboot?web項(xiàng)目中?Set-Cookie?失敗原因及解決辦法

    springboot?web項(xiàng)目中?Set-Cookie?失敗原因及解決辦法

    這篇文章主要介紹了springboot?web項(xiàng)目中?Set-Cookie?失敗原因及解決辦法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-10-10
  • Mybatis模糊查詢和動(dòng)態(tài)sql語句的用法

    Mybatis模糊查詢和動(dòng)態(tài)sql語句的用法

    今天小編就為大家分享一篇關(guān)于Mybatis模糊查詢和動(dòng)態(tài)sql語句的用法,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧
    2019-03-03
  • SpringBoot中的@FeignClient注解使用

    SpringBoot中的@FeignClient注解使用

    文章主要介紹了SpringCloud中的@FeignClient注解的使用及其參數(shù)詳解,包括value/name、url、path、configuration、fallback/fallbackFactory、contextId等,通過@FeignClient注解,可以方便地聲明一個(gè)REST客戶端,并定義與目標(biāo)服務(wù)通信的接口
    2024-11-11

最新評(píng)論

蓬莱市| 铁力市| 津南区| 巫溪县| 许昌县| 碌曲县| 明水县| 仲巴县| 巴楚县| 图片| 垣曲县| 准格尔旗| 新龙县| 太湖县| 滦平县| 越西县| 鄂伦春自治旗| 沭阳县| 孙吴县| 射洪县| 大宁县| 孝感市| 慈利县| 平安县| 朝阳市| 鄂托克前旗| 永和县| 杭锦旗| 沽源县| 新龙县| 长宁区| 栾城县| 凤冈县| 于田县| 桑日县| 南汇区| 隆子县| 偏关县| 溆浦县| 文昌市| 台江县|