Tabnine Logo
Display.dispose
Code IndexAdd Tabnine to your IDE (free)

How to use
dispose
method
in
org.eclipse.swt.widgets.Display

Best Java code snippets using org.eclipse.swt.widgets.Display.dispose (Showing top 20 results out of 351)

Refine searchRefine arrow

  • Display.sleep
  • Display.readAndDispatch
  • Shell.isDisposed
  • Display.<init>
  • Shell.open
  • Shell.setLayout
origin: stackoverflow.com

 public static void main(String[] args) {
  Display display = new Display();
  Shell shell = new Shell(display);
  shell.open();
  DirectoryDialog dialog = new DirectoryDialog(shell);
  dialog.setFilterPath("c:\\"); // Windows specific
  System.out.println("RESULT=" + dialog.open());
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
      display.sleep();
  }
  display.dispose();
}
origin: stackoverflow.com

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();
origin: stackoverflow.com

 public static void main( String[] args ) {
  Display display = new Display();
  Shell shell = new Shell( display );
  shell.setLayout( new FillLayout() );
  final Table table = new Table( shell, SWT.VIRTUAL );
  table.setItemCount( 10000 );
  table.addListener( SWT.SetData, new Listener() {
    public void handleEvent( Event event ) {
      TableItem item = (TableItem)event.item;
      item.setText( "Item " + table.indexOf( item ) );
    }
  } );
  shell.setSize( 300, 500 );
  shell.open();
  while( !shell.isDisposed() ) {
    if( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  display.dispose();
}
origin: pentaho/pentaho-kettle

public static void main( String[] args ) {
 DeviceData data = new DeviceData();
 data.tracking = true;
 Display display = new Display( data );
 Sleak sleak = new Sleak();
 Shell shell = new Shell( display );
 shell.setText( "S-Leak" );
 Point size = shell.getSize();
 shell.setSize( size.x / 2, size.y / 2 );
 sleak.create( shell );
 shell.open();
 // Launch your application here
 // e.g.
 // Shell shell = new Shell(display);
 // Button button1 = new Button(shell, SWT.PUSH);
 // button1.setBounds(10, 10, 100, 50);
 // button1.setText("Hello World");
 // Image image = new Image(display, 20, 20);
 // Button button2 = new Button(shell, SWT.PUSH);
 // button2.setBounds(10, 70, 100, 50);
 // button2.setImage(image);
 // shell.open();
 while ( !shell.isDisposed() ) {
  if ( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
 display.dispose();
}
origin: caoxinyu/RedisClient

/**
 * Open the window.
 * 
 */
public void open() {
  Display display = null;
  display = Display.getDefault();
  createContents();
  shell.open();
  shell.layout();
  while (!shell.isDisposed()) {
    try {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    } catch (Exception e) {
      MessageDialog.openError(shell,
          i18nFile.getText(I18nFile.ERROR),
          e.getLocalizedMessage());
      e.printStackTrace();
    }
  }
  display.dispose();
}
origin: stackoverflow.com

Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
shell.setText("Hide Label");
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();
origin: stackoverflow.com

 import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class SWTFileOpenSnippet {
  public static void main (String [] args) {
    Display display = new Display ();
    Shell shell = new Shell (display);
    // Don't show the shell.
    //shell.open ();  
    FileDialog dialog = new FileDialog (shell, SWT.OPEN | SWT.MULTI);
    String [] filterNames = new String [] {"All Files (*)"};
    String [] filterExtensions = new String [] {"*"};
    String filterPath = "c:\\";
    dialog.setFilterNames (filterNames);
    dialog.setFilterExtensions (filterExtensions);
    dialog.setFilterPath (filterPath);
    dialog.open();
    System.out.println ("Selected files: ");
    String[] selectedFileNames = dialog.getFileNames();
    for(String fileName : selectedFileNames) {
      System.out.println("  " + fileName);
    }
    shell.close();
    while (!shell.isDisposed ()) {
      if (!display.readAndDispatch ()) display.sleep ();
    }
    display.dispose ();
  }
}
origin: stackoverflow.com

Display display = new Display ();
shell.open ();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch ()) display.sleep ();
display.dispose ();
origin: stackoverflow.com

 Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
Label label = new Label(shell, SWT.NONE);
label.setText("I am italic");
FontData fontData = label.getFont().getFontData()[0];
Font font = new Font(display, new FontData(fontData.getName(), fontData
  .getHeight(), SWT.ITALIC));
label.setFont(font);
shell.open();
while (!shell.isDisposed()) {
 if (!display.readAndDispatch())
  display.sleep();
}
font.dispose();
display.dispose();
origin: stackoverflow.com

Display display = new Display();
final Shell shell = new Shell(display);
shell.setText("StackOverflow");
shell.setLayout(new GridLayout(1, true));
shell.open();
while (!shell.isDisposed())
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();
origin: stackoverflow.com

Display display = new Display();
Shell shell = new Shell(display);
RowLayout layout = new RowLayout(SWT.VERTICAL);
layout.fill = true;
shell.setLayout(layout);
shell.setSize(200, 200);
final Table table = new Table(shell, SWT.BORDER | SWT.MULTI);
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();
origin: stackoverflow.com

final Shell shell = new Shell(display);
shell.setText("StackOverflow");
shell.setLayout(new FillLayout());
shell.open();
while (!shell.isDisposed())
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();
origin: stackoverflow.com

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new RowLayout(SWT.VERTICAL));
final ToolTip tip = new ToolTip(shell, SWT.BALLOON);
tip.setMessage("Here is a message for the user. When the message is too long it wraps. I should say something cool but nothing comes to my mind.");
tfNext.setText("TF without tooltip");
shell.setBounds(50, 50, 300, 200);
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();
origin: stackoverflow.com

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.open();
while(!shell.isDisposed())
  if(!display.readAndDispatch())
    display.sleep();
display.dispose();
origin: stackoverflow.com

 Display display = new Display();
Shell shell = new Shell(display);
// Define message box
shell.open();
while (!shell.isDisposed()) {
  if (display.readAndDispatch()) {
    display.sleep();
  }
}
display.dispose();
origin: stackoverflow.com

 import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class FirstSWTApplication {

public static void main(String[] args) {
  Display display = new Display();
  Shell shell = new Shell(display);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
      display.sleep();
  }
  display.dispose();
}
origin: stackoverflow.com

 public static void main(String[] args) {
  final Display display = new Display();
  Shell shell = new Shell(display);

  final int style = OS.GetWindowLong(shell.handle, OS.GWL_STYLE);
  OS.SetWindowLong(shell.handle, OS.GWL_STYLE, style & ~0x00040000);

  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch()) {
      display.sleep();
    }
  }
  display.dispose();
}
origin: org.eclipse/org.eclipse.help.ui

public void run() {
  d = new Display();
  while (runEventLoop) {
    if (!d.readAndDispatch()) {
      d.sleep();
    }
  }
  d.dispose();
}
public Display getDisplay() {
origin: com.eclipsesource.tabris/tabris

private void readAndDispatch( Display display, Shell shell ) {
 while( !shell.isDisposed() ) {
  if( !display.readAndDispatch() ) {
   display.sleep();
  }
 }
 display.dispose();
}
origin: stackoverflow.com

 import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class ReadOnlyTextExample {
 public static void main(String[] args) {
  Display display = new Display();
  Shell shell = new Shell(display);
  shell.setLayout(new GridLayout(1, false));


  // Create a read-only text field
  new Text(shell, SWT.READ_ONLY | SWT.BORDER).setText("Read Only");


  shell.open();
  while (!shell.isDisposed()) {
   if (!display.readAndDispatch()) {
    display.sleep();
   }
  }
  display.dispose();
 }
}
org.eclipse.swt.widgetsDisplaydispose

Javadoc

Causes the run() method of the runnable to be invoked by the user-interface thread just before the receiver is disposed. Specifying a null runnable is ignored.

Popular methods of Display

  • asyncExec
    Causes the run() method of the runnable to be invoked by the user-interface thread at the next reaso
  • getCurrent
    Returns the display which the currently running thread is the user-interface thread for, or null if
  • getDefault
    Returns the default display. One is created (making the thread that invokes this method its user-int
  • getSystemColor
    Returns the matching standard color for the given constant, which should be one of the color constan
  • readAndDispatch
    Reads an event from the operating system's event queue, dispatches it appropriately, and returns tru
  • syncExec
    Causes the run() method of the runnable to be invoked by the user-interface thread at the next reaso
  • sleep
    Causes the user-interface thread to sleep (that is, to be put in a state where it does not consume C
  • getActiveShell
    Returns the currently active Shell, or null if no shell belonging to the currently running applicati
  • isDisposed
  • timerExec
    Causes the run() method of the runnable to be invoked by the user-interface thread after the specifi
  • getThread
    Returns the user-interface thread for the receiver.
  • getFocusControl
    Returns the control which currently has keyboard focus, or null if keyboard events are not currently
  • getThread,
  • getFocusControl,
  • getSystemCursor,
  • getSystemImage,
  • <init>,
  • getBounds,
  • getCursorLocation,
  • addFilter,
  • beep

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now