Guest User

Untitled

a guest
Apr 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. package org.me.myapp;
  2.  
  3. import org.eclipse.jface.window.ApplicationWindow;
  4. import org.eclipse.swt.SWT;
  5. import org.eclipse.swt.widgets.Composite;
  6. import org.eclipse.swt.widgets.Control;
  7. import org.eclipse.swt.widgets.Display;
  8. import org.eclipse.swt.widgets.Text;
  9.  
  10.  
  11. public class MyJFaceApp extends ApplicationWindow
  12. {
  13.  
  14. public MyJFaceApp()
  15. {
  16. super(null);
  17. }
  18.  
  19. protected Control createContents(Composite parent)
  20. {
  21. Text helloText = new Text(parent, SWT.CENTER);
  22. helloText.setText("Hello SWT and JFace!");
  23. parent.pack();
  24. return parent;
  25. }
  26.  
  27. public static void main( String[] args )
  28. {
  29. MyJFaceApp awin = new MyJFaceApp();
  30. awin.setBlockOnOpen(true);
  31. awin.open();
  32. Display.getCurrent().dispose();
  33. }
  34. }
Add Comment
Please, Sign In to add comment