小编use*_*687的帖子

18
推荐指数
1
解决办法
2万
查看次数

如何在单击按钮后重新绘制swt合成以更改该合成的内容

我是SWT的新手.我正在研究的项目有一个主要的复合材料,上面有3个儿童复合材料.Upper复合材料由按钮组成,中间复合材料用于显示内容,下部复合材料用于其他目的.当我单击上部合成中的按钮时,它必须触发中间合成中的内容更改.这是我习惯做的代码

public void widgetSelected(SelectionEvent e) {
    /* Retrieve the contents that are currently in middle composite*/
    Composite currentCenterComposite = EMWindow.getCenterCompsiteState();
    /* Retrieve the main composite*/
    Composite outerComposite=EMWindow.getOuterCompsiteState();
    if ((currentCenterComposite != null) && (!currentCenterComposite.isDisposed())) {
    /* Remove children that are already laid out */
    Object[] children = currentCenterComposite.getChildren (); 
    for (int i = 0; i < children.length; i++) {
 ((Composite)children[i]).dispose();
     }
    }

    currentCenterComposite = new CenterComp(currentCenterComposite);
    GridData gd_centerComposite = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
    gd_centerComposite.minimumHeight = 50;
    currentCenterComposite.setLayoutData(gd_centerComposite);
    currentCenterComposite.layout(true); …
Run Code Online (Sandbox Code Playgroud)

java swt

5
推荐指数
1
解决办法
7832
查看次数

标签 统计

database ×1

h2 ×1

java ×1

stored-procedures ×1

swt ×1