Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Widget has the wrong parent, tabfolder in tabfolder
Widget has the wrong parent, tabfolder in tabfolder [message #463612] Thu, 10 November 2005 18:21 Go to next message
Eclipse UserFriend
Originally posted by: brigitte.ilsanker.gi-de.com

I'm trying to nest TabFolders: I want to place a tabfolder into another
tabfolder and get the Exception in thread "main"
java.lang.IllegalArgumentException: Widget has the wrong parent

The code is:

private void createTabFolder1() {
GridData gridData2 = new GridData();
gridData2.heightHint = 650;
tabFolder1 = new TabFolder(sShell, SWT.NONE);
tabFolder1.setLayoutData(gridData2);
TabItem tabItem1 = new TabItem(tabFolder1, SWT.NULL);
tabItem1.setText("Environment");
Text text1 = new Text(tabFolder1, SWT.BORDER);
text1.setText("Das ist der Tab Environment");
tabItem1.setControl(text1);
TabItem tabItem2 = new TabItem(tabFolder1, SWT.NULL);
tabItem2.setText("Customer");
Text text2 = new Text(tabFolder1, SWT.BORDER);
text2.setText("Das ist der Tab Customer");
tabItem2.setControl(text2);
tabFolder1.setSize(400, 200);
createTabFolderEnv();
}
private void createTabFolderEnv() {
tabFolderEnv = new TabFolder(tabFolder1, SWT.NONE);
TabItem tabItem11 = new TabItem(tabFolderEnv, SWT.NULL);
tabItem11.setText("Input File Locations");
Text text11 = new Text(tabFolder1, SWT.BORDER);
text11.setText("Input File Locations");
tabItem11.setControl(text11);
TabItem tabItem22 = new TabItem(tabFolderEnv, SWT.NULL);
tabItem22.setText("Output File Locations");
Text text22 = new Text(tabFolder1, SWT.BORDER);
text22.setText("Output File Locations");
tabItem22.setControl(text22);
}


Is it possible at all to have nested tabfolders?

Thanks
Brigitte
Re: Widget has the wrong parent, tabfolder in tabfolder [message #463613 is a reply to message #463612] Thu, 10 November 2005 18:24 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

> private void createTabFolderEnv() {
> tabFolderEnv = new TabFolder(tabFolder1, SWT.NONE);
> TabItem tabItem11 = new TabItem(tabFolderEnv, SWT.NULL);
> tabItem11.setText("Input File Locations");
> Text text11 = new Text(tabFolder1, SWT.BORDER);
> text11.setText("Input File Locations");
> tabItem11.setControl(text11);
> TabItem tabItem22 = new TabItem(tabFolderEnv, SWT.NULL);
> tabItem22.setText("Output File Locations");
> Text text22 = new Text(tabFolder1, SWT.BORDER);
> text22.setText("Output File Locations");
> tabItem22.setControl(text22);
> }
>
>
> Is it possible at all to have nested tabfolders?
>
> Thanks
> Brigitte
>
>
>
>

Your text11 and text22 are being parented by tabFolder1, but you are
setting them into tabItems that are for tabFolderEnv. That is not allowed.

--
Thanks,
Rich Kulp
Previous Topic:Basic wizard questions
Next Topic:Is there a SWT Widget that creates a Label & Text for you all together?
Goto Forum:
  


Current Time: Wed Apr 24 17:13:11 GMT 2024

Powered by FUDForum. Page generated in 0.02903 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top