Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 22322 - AWT Container is a SWT container does not get its background painted in JDK 1.4.0
Summary: AWT Container is a SWT container does not get its background painted in JDK 1...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 37724
  Show dependency tree
 
Reported: 2002-08-09 15:11 EDT by Jim Adams CLA
Modified: 2003-08-12 17:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Adams CLA 2002-08-09 15:11:47 EDT
I have a simple MultiPageEditor class that creates a page containing an AWT 
Panel. The panel does no refresh its background until the mouse enters the 
area.
	void createPage3() {
		Composite composite = new Composite(getContainer(), SWT.NONE);
		 //code example
		 composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL 
| GridData.FILL_VERTICAL)); 
		 java.awt.Panel awtPanel = SWT_AWT.new_Panel(composite);  // 
this is java swing panel in the composite.
		 try
		 {
		 	UIManager.setLookAndFeel
(UIManager.getSystemLookAndFeelClassName());
		 }
		 catch(Exception e){}
		 
		 java.awt.Button f2 = new java.awt.Button("d");
		 f2.setLocation(100,100);
		 java.awt.Button f1=new java.awt.Button("Button");
		 awtPanel.setLayout(null); 
		 awtPanel.add(f1);
		 f1.setLocation(100,100);
		 f1.setSize(f1.getPreferredSize());
		 f1.setVisible(true);
		 awtPanel.setBackground(java.awt.Color.red);

		int index = addPage(composite);
		setPageText(index, "Preview");
	}

When you use this page, the red background does not display until you move the 
mouse over the area. This works fine with JDK 1.3.1_03. Note that this also 
fails in JDK 1.4.1 RC1
Comment 1 Silenio Quarti CLA 2003-08-12 17:53:08 EDT
This is a problem in the 1.4.1 VM and it appears to work in 1.4.2.