Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seems more like a platform issue than a SWT problem. Although not related but there was a platform <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=25615" rel="nofollow noreferrer">specific bug</a> for <code>setBackground()</code> of <code>TabFolder</code>, it may or may not be related to your current problem.</p> <p>One <strong><em>workaround</em></strong> is to use <code>CTabFolder</code>. See the below snippet and output:</p> <p><strong><code>Output on Windows 7, using JDK 1.6_b30, Eclipse 3.7</code></strong></p> <p><img src="https://i.stack.imgur.com/3Tmgz.png" alt="enter image description here"></p> <p><strong><code>Code:</code></strong></p> <pre><code>import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabItem; public class TabTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout()); shell.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); CTabFolder tabFolder = new CTabFolder (shell, SWT.BORDER|SWT.FLAT); tabFolder.setLayout(new GridLayout()); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); CTabItem item = new CTabItem(tabFolder, SWT.NULL); item.setText ("Tab Item"); Composite comp = new Composite(tabFolder, SWT.NONE); comp.setLayout(new GridLayout()); comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); item.setControl(comp); Button button = new Button(comp, SWT.PUSH); button.setText("Button "); tabFolder.setSize (160, 100); item = new CTabItem(tabFolder, SWT.NULL); item.setText ("Tab Item"); //Event Loop shell.pack (); shell.open (); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload