Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 79735 Details for
Bug 205199
[Win32]setImage(null) on Label overrides text
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Testcase
Test.java (text/x-java), 1.31 KB, created by
Fabian Zeindl
on 2007-10-04 11:12:23 EDT
(
hide
)
Description:
Testcase
Filename:
MIME Type:
Creator:
Fabian Zeindl
Created:
2007-10-04 11:12:23 EDT
Size:
1.31 KB
patch
obsolete
>import org.eclipse.swt.*; >import org.eclipse.swt.widgets.*; >import org.eclipse.swt.events.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; > >public class Test >{ > public static void main(String[] args) > { > new Test(); > } > > private Image image; > private Label label; > private int state=0; > > public Test() > { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout( new FillLayout()); > > // Create an image > this.image = new Image (display, 16, 16); > Color color = display.getSystemColor (SWT.COLOR_RED); > GC gc = new GC (image); > gc.setBackground (color); > gc.fillRectangle (image.getBounds()); > gc.dispose (); > > this.label = new Label(shell,SWT.NONE); > Button button = new Button(shell,SWT.PUSH); > button.setText("click Me"); > button.addSelectionListener( > new SelectionAdapter() > { > public void widgetSelected(SelectionEvent e) > { > if (state == 0) > { > label.setImage(image); > label.setText("1. text"); > } > else if (state == 1) > { > label.setText("2. text"); > label.setImage(image); > } > else if (state == 2) > { > label.setText("3. text"); > label.setImage(null); > } > state++; > } > } > ); > > shell.open(); > while (!shell.isDisposed()) > if (!display.readAndDispatch()) > display.sleep(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 205199
: 79735 |
278823