Hi All,
In my application I have few Tabfolders. When I start the application I need that a specific tabItem in each of the tabFolders will be open and show its content.
How can I achive that operation?
bab086
Thanks,
HBC.
Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg
final Display display = new Display();
final Shell shell = new Shell();
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
shell.setLayout(gridLayout);
shell.setText("SWT Application");
{
m_TabFolder = new TabFolder(shell, SWT.NONE);
m_TabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
{
final TabItem tabItem = new TabItem(m_TabFolder, SWT.NONE);
tabItem.setText("item1");
{
final Button button = new Button(m_TabFolder, SWT.NONE);
tabItem.setControl(button);
button.setText("button1");
}
}
{
final TabItem tabItem = new TabItem(m_TabFolder, SWT.NONE);
tabItem.setText("item2");
{
final Button button = new Button(m_TabFolder, SWT.NONE);
tabItem.setControl(button);
button.setText("button2");
}
}
}
m_TabFolder.setSelection(1);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
Users browsing this forum: No registered users and 1 guest