Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 210832 - The frame disappear when using 'Group' control
Summary: The frame disappear when using 'Group' control
Status: RESOLVED DUPLICATE of bug 145662
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-24 07:20 EST by Jun CLA
Modified: 2007-11-27 14:28 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jun CLA 2007-11-24 07:20:42 EST
I create a GUI using SWT. When I implement 'Group' control to my user interface and set it background color to white. and there are textbox in the group. then each time I press tab key the frame or border of the group control was disappeared?
Comment 1 Jun CLA 2007-11-24 07:22:21 EST
I will send the source later if need?

Thanks million!!! :)
Comment 2 Remy Suen CLA 2007-11-24 08:55:37 EST
(In reply to comment #1)
> I will send the source later if need?

Please attach a small isolated test case that reproduces the behaviour in question.
Comment 3 Jun CLA 2007-11-24 09:29:23 EST
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
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.Label;

public class CompViewer extends ApplicationWindow {

  public CompViewer() {
    super(null);
  }

  protected Control createContents(Composite parent) {
    Ch3_Group cc1 = new Ch3_Group(parent);
    return parent;
  }

  public static void main(String[] args) {
    CompViewer cv = new CompViewer();
    cv.setBlockOnOpen(true);
    cv.open();
    Display.getCurrent().dispose();
  }
}

class Ch3_Group extends Composite {
  public Ch3_Group(Composite parent) {
    super(parent, SWT.NONE);
    Group group = new Group(this, SWT.SHADOW_ETCHED_IN);
    group.setText("Group Label");
    group.setBackground(display.getSystemColor(SWT.COLOR_RED));
   
    Label label = new Label(group, SWT.NONE);
    label.setText("Two buttons:");
    label.setLocation(20, 20);
    label.pack();

    Button button1 = new Button(group, SWT.PUSH);
    button1.setText("Push button");
    button1.setLocation(20, 45);
    button1.pack();

    Button button2 = new Button(group, SWT.CHECK);
    button2.setText("Check button");
    button2.setBounds(20, 75, 90, 30);
    group.pack();
  }
}
Comment 4 Steve Northover CLA 2007-11-27 14:25:44 EST
This code WORKSFORME in SWT from HEAD:

import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class PR_210832 {
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout ());
		Group group = new Group(shell, SWT.SHADOW_ETCHED_IN);
		group.setText("Group Label");
		group.setBackground(display.getSystemColor(SWT.COLOR_RED));

		Label label = new Label(group, SWT.NONE);
		label.setText("Two buttons:");
		label.setLocation(20, 20);
		label.pack();

		Button button1 = new Button(group, SWT.PUSH);
		button1.setText("Push button");
		button1.setLocation(20, 45);
		button1.pack();

		Button button2 = new Button(group, SWT.CHECK);
		button2.setText("Check button");
		button2.setBounds(20, 75, 90, 30);
		group.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
Comment 5 Steve Northover CLA 2007-11-27 14:28:08 EST
Please reopen if not a duplicate and/or you can get my test code to fail (or provide some test code of your own that fails).  What a mouthful!

*** This bug has been marked as a duplicate of bug 145662 ***