0
請幫助我,我是SWT的原始人。 我想將CTabFolder
放在另一個CTabFolder
內。 我已經嘗試了下面的代碼,但它的不完整。我如何將CtabFolder放置在SWT中的另一個CTabfolder內
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import sun.awt.HorizBagLayout;
public class LayoutExample2
{
public static void main(String[] args) {
Display display=new Display();
Shell shell=new Shell(display);
shell.setLayout(new GridLayout());
CTabFolder ctf_main=new CTabFolder(shell,SWT.RIGHT_TO_LEFT);
CTabItem ctb1=new CTabItem(ctf_main,SWT.NONE);
ctf_main.setSimple(false);
ctf_main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
ctf_main.pack();
ctb1.setText("Error Management Portal ");
CTabFolder ctf_inner=new CTabFolder(ctf_main,SWT.RIGHT_TO_LEFT);
CTabItem tbi1=new CTabItem(ctf_main,SWT.FLAT);
tbi1.setText("Search ");
shell.setMaximized(true);
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
請幫我把Ctabfolder
內的另一個Ctabfolder
...
我敢肯定' CTabItem'沒有'setContent()'方法。 –