0
我創建了一個包含兩個對象的複合(SWT):標籤和文本。如何在SWT中隱藏組合?
在某些情況下,我不希望看到這些小部件。當我按下一個按鈕時,我想隱藏組合。
我必須選擇隱藏複合材料,所以它不會按住屏幕上的地方嗎? (我不希望看到的空行,我旁邊有其他對象)
我可怎麼辦呢?
Composite comp = new Composite(shell, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
Label label = new Label(comp , SWT.BORDER);
label.setText("This is a label:");
label.setToolTipText("This is the tooltip of this label");
Text text = new Text(comp , SWT.NONE);
text.setText("This is the text in the text widget");
text.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
text.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
隱藏是非常不同的模式比配置,特別是對於那些可能有其他的孩子,等等。這不應該被推薦的更復雜的部件。 – Krease