Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TabFolder: Display-Problem
TabFolder: Display-Problem [message #439356] Mon, 12 July 2004 10:37 Go to next message
Eclipse UserFriend
Originally posted by: shake.web.de

Hi,

I have a problem with TabFolder. I use WinXP with Eclipse 3.0
Take a look at the following screenshot:

http://www.xore.de/temp/Tabs.gif

The TabFolder in Project-Properties -- Java Build Path has also some
"troubles". But at least the background of the TabItems isn't white...

http://www.xore.de/temp/Tabs2.gif


Can u help me?





Here comes the code for the ViewPart that contains the TabFolder.


public class TimeEditView extends ViewPart {
public static final String ID_VIEW =
"de.xore.xoretime.ui.TimeEditView";

public void createPartControl( Composite parent ) {
setContentDescription( "Bearbeitungs-Fenster" );
parent.setLayout( prepareLayout() );

TabFolder tabFolder = new TabFolder( parent, SWT.TOP );
tabFolder.setLayoutData( new GridData(
GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL |
GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL ) );
System.out.println( "parent.color " + parent.getBackground() );
System.out.println( "tabFolder.color: " +
tabFolder.getBackground() );

TabItem tabItem = new TabItem( tabFolder, SWT.BORDER );
tabItem.setText( "Tab1" );
Label label = new Label( tabFolder, SWT.NONE );
label.setText( "TheLabelText" );
tabItem.setControl( label );


TabItem tabItem2 = new TabItem( tabFolder, SWT.DEFAULT );
tabItem2.setText( "Tab2" );
label = new Label( tabFolder, SWT.NONE );
label.setText( "TheLabelText2" );
tabItem2.setControl( label );


TabItem tabItem3 = new TabItem( tabFolder, SWT.NONE );
tabItem3.setText( "Tab3" );
label = new Label( tabFolder, SWT.NONE );
label.setText( "TheLabelText3" );
tabItem3.setControl( label );


}

private GridLayout prepareLayout() {
GridLayout layout = new GridLayout();
layout.marginWidth = 12;
layout.marginHeight = 12;
layout.horizontalSpacing = 5;
layout.verticalSpacing = 5;
layout.numColumns = 3;
return layout;
}


public void setFocus() {
}

}



Thanks,

Johannes Schneider
Re: TabFolder: Display-Problem [message #439432 is a reply to message #439356] Mon, 12 July 2004 17:47 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=24538

"Johannes Schneider" <shake@web.de> wrote in message
news:cctpjp$eq2$1@eclipse.org...
> Hi,
>
> I have a problem with TabFolder. I use WinXP with Eclipse 3.0
> Take a look at the following screenshot:
>
> http://www.xore.de/temp/Tabs.gif
>
> The TabFolder in Project-Properties -- Java Build Path has also some
> "troubles". But at least the background of the TabItems isn't white...
>
> http://www.xore.de/temp/Tabs2.gif
>
>
> Can u help me?
>
>
>
>
>
> Here comes the code for the ViewPart that contains the TabFolder.
>
>
> public class TimeEditView extends ViewPart {
> public static final String ID_VIEW =
> "de.xore.xoretime.ui.TimeEditView";
>
> public void createPartControl( Composite parent ) {
> setContentDescription( "Bearbeitungs-Fenster" );
> parent.setLayout( prepareLayout() );
>
> TabFolder tabFolder = new TabFolder( parent, SWT.TOP );
> tabFolder.setLayoutData( new GridData(
> GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL |
> GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL ) );
> System.out.println( "parent.color " + parent.getBackground() );
> System.out.println( "tabFolder.color: " +
> tabFolder.getBackground() );
>
> TabItem tabItem = new TabItem( tabFolder, SWT.BORDER );
> tabItem.setText( "Tab1" );
> Label label = new Label( tabFolder, SWT.NONE );
> label.setText( "TheLabelText" );
> tabItem.setControl( label );
>
>
> TabItem tabItem2 = new TabItem( tabFolder, SWT.DEFAULT );
> tabItem2.setText( "Tab2" );
> label = new Label( tabFolder, SWT.NONE );
> label.setText( "TheLabelText2" );
> tabItem2.setControl( label );
>
>
> TabItem tabItem3 = new TabItem( tabFolder, SWT.NONE );
> tabItem3.setText( "Tab3" );
> label = new Label( tabFolder, SWT.NONE );
> label.setText( "TheLabelText3" );
> tabItem3.setControl( label );
>
>
> }
>
> private GridLayout prepareLayout() {
> GridLayout layout = new GridLayout();
> layout.marginWidth = 12;
> layout.marginHeight = 12;
> layout.horizontalSpacing = 5;
> layout.verticalSpacing = 5;
> layout.numColumns = 3;
> return layout;
> }
>
>
> public void setFocus() {
> }
>
> }
>
>
>
> Thanks,
>
> Johannes Schneider
>
Previous Topic:Programmatically generate images with ImageData
Next Topic:what's GP in the article: " SWT: The Standard Widget Toolkit - Part 1"
Goto Forum:
  


Current Time: Thu Sep 26 18:51:12 GMT 2024

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

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

Back to the top