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 201225 Details for
Bug 354351
Shells that have a menu are incorrectly sized on Ubuntu 11
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.
Sample code
SwtTest.java (text/plain), 1.64 KB, created by
Juris Olekss
on 2011-08-10 05:55:50 EDT
(
hide
)
Description:
Sample code
Filename:
MIME Type:
Creator:
Juris Olekss
Created:
2011-08-10 05:55:50 EDT
Size:
1.64 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Menu; >import org.eclipse.swt.widgets.MenuItem; >import org.eclipse.swt.widgets.Shell; > >public class SwtTest { > > private Display display; > private Shell shell; > > private void buildUI() { > > shell = new Shell(display,SWT.CLOSE); > shell.setText("SWT Test"); > shell.setLayout(new GridLayout()); > > Menu menuBar = new Menu(shell, SWT.BAR); > shell.setMenuBar(menuBar); > MenuItem fileMenu = new MenuItem(menuBar,SWT.CASCADE); > Menu fileSubmenu = new Menu(shell, SWT.DROP_DOWN); > fileMenu.setMenu(fileSubmenu); > fileMenu.setText("File"); > MenuItem menuItem = new MenuItem(fileSubmenu,SWT.NONE); > menuItem.setText("Menu Item"); > > Label l = new Label(shell,SWT.NONE); > l.setText("This is some random text."); > > Button button = new Button(shell, SWT.NONE); > button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > button.setText("Button"); > > shell.addListener(SWT.Close, new Listener() { > public void handleEvent(Event event) { > shell.dispose(); > } > }); > > shell.pack(); > > } > > public SwtTest() { > > display = new Display(); > > buildUI(); > > if (!shell.isDisposed()) > shell.open (); > > while (!shell.isDisposed ()) { > if (!display.readAndDispatch ()) display.sleep (); > } > > } > > > public static void main(String[] args) { > > new SwtTest(); > > } > >}
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 354351
:
201223
|
201224
| 201225