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 4470 Details for
Bug 4417
SWT/AWT integration only works on Windows
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
AWTinSWT (hangs on Solaris, GP's on Linux)
(text/plain), 2.25 KB, created by
Steve Northover
on 2003-04-04 17:57:43 EST
(
hide
)
Description:
AWTinSWT (hangs on Solaris, GP's on Linux)
Filename:
MIME Type:
Creator:
Steve Northover
Created:
2003-04-04 17:57:43 EST
Size:
2.25 KB
patch
obsolete
>package interop; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.layout.GridData; > >//import org.eclipse.swt.internal.awt.win32.*; >import awt.*; > >import java.awt.Button; >import java.awt.Panel; >import java.awt.Dimension; >import java.awt.event.ActionListener; >import java.awt.event.ActionEvent; > >public class AWTInSWT { > >public static void main(String[] args) { > > /* Create SWT Widgets */ > Shell shell = new Shell(); > shell.setLayout(new org.eclipse.swt.layout.GridLayout()); > final Display display = shell.getDisplay(); > shell.setText("Outer window is org.eclipse.swt.widgets.Shell"); > > org.eclipse.swt.widgets.Button swtButton = new org.eclipse.swt.widgets.Button(shell, SWT.PUSH); > swtButton.setText("SWT Button"); > swtButton.setSize(swtButton.computeSize(SWT.DEFAULT, SWT.DEFAULT)); > swtButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); > > /* Allocate an area for the AWT widgets */ > Composite composite = new Composite(shell, SWT.NONE); > composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); > Panel awtPanel = SWT_AWT.new_Panel(composite); > awtPanel.setLayout(new java.awt.FlowLayout()); > > final Label status = new Label(shell, SWT.BORDER | SWT.READ_ONLY); > status.setText("Status information"); > status.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > > swtButton.addListener(SWT.Selection, new Listener () { > public void handleEvent (Event event) { > status.setText ("SWT Button Selected"); > } > }); > > /* Create AWT and Swing Widgets */ > Button awtButton = new Button("AWT Button"); > awtPanel.add(awtButton); > awtButton.addActionListener(new ActionListener () { > public void actionPerformed (ActionEvent event) { > display.syncExec (new Runnable () { > public void run () { > status.setText ("AWT Button Selected"); > } > }); > } > }); > > shell.setSize(700, 300); > shell.open(); > > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) display.sleep (); > } > > System.exit(0); >} >} >
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 4417
:
3744
|
4469
| 4470 |
4471
|
4681