Example usage for java.lang Runnable Runnable

List of usage examples for java.lang Runnable Runnable

Introduction

In this page you can find the example usage for java.lang Runnable Runnable.

Prototype

Runnable

Source Link

Usage

From source file:ImageIOTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new ImageIOFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*ww w .j  a  va 2 s. com*/
        }
    });
}

From source file:TableCellRenderTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {

            JFrame frame = new TableCellRenderFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);// w ww . j  ava  2  s  .c o m
        }
    });
}

From source file:dpcs.About.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            try {
                About frame = new About();
                frame.setVisible(true);/*from w w w . j ava 2  s  . c  o  m*/
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:gtu._work.ui.StringArrayMakerUI.java

/**
 * Auto-generated main method to display this JFrame
 *///from w w w. ja v a2s.c  om
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            StringArrayMakerUI inst = new StringArrayMakerUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:Snippet104.java

public static void main(String[] args) {
    final Display display = new Display();
    final int[] count = new int[] { 4 };
    final Image image = new Image(display, 300, 300);
    final Shell splash = new Shell(SWT.ON_TOP);
    final ProgressBar bar = new ProgressBar(splash, SWT.NONE);
    bar.setMaximum(count[0]);// w ww.  j  a  v a2s  . c  o m
    Label label = new Label(splash, SWT.NONE);
    label.setImage(image);
    FormLayout layout = new FormLayout();
    splash.setLayout(layout);
    FormData labelData = new FormData();
    labelData.right = new FormAttachment(100, 0);
    labelData.bottom = new FormAttachment(100, 0);
    label.setLayoutData(labelData);
    FormData progressData = new FormData();
    progressData.left = new FormAttachment(0, 5);
    progressData.right = new FormAttachment(100, -5);
    progressData.bottom = new FormAttachment(100, -5);
    bar.setLayoutData(progressData);
    splash.pack();
    Rectangle splashRect = splash.getBounds();
    Rectangle displayRect = display.getBounds();
    int x = (displayRect.width - splashRect.width) / 2;
    int y = (displayRect.height - splashRect.height) / 2;
    splash.setLocation(x, y);
    splash.open();
    display.asyncExec(new Runnable() {
        public void run() {
            Shell[] shells = new Shell[count[0]];
            for (int i = 0; i < count[0]; i++) {
                shells[i] = new Shell(display);
                shells[i].setSize(300, 300);
                shells[i].addListener(SWT.Close, new Listener() {
                    public void handleEvent(Event e) {
                        --count[0];
                    }
                });
                bar.setSelection(i + 1);
                try {
                    Thread.sleep(1000);
                } catch (Throwable e) {
                }
            }
            splash.close();
            image.dispose();
            for (int i = 0; i < count[0]; i++) {
                shells[i].open();
            }
        }
    });
    while (count[0] != 0) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}

From source file:gtu._work.etc.HotnoteMakerUI.java

/**
* Auto-generated main method to display this JFrame
*//*from   w  w  w .  j a  v a 2 s .  co m*/
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            HotnoteMakerUI inst = new HotnoteMakerUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:gtu._work.ui.EstoreDAOCodeGenerateUI.java

/**
 * Auto-generated main method to display this JFrame
 *///from  w w  w.  j a va  2 s .c o  m
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            EstoreDAOCodeGenerateUI inst = new EstoreDAOCodeGenerateUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:gtu.zcognos.SimpleUI.java

/**
 * Auto-generated main method to display this JFrame
 *//*from   w  w  w.ja va  2s.c o  m*/
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            SimpleUI inst = new SimpleUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
    System.out.println("done...");
}

From source file:gtu._work.ui.RetryByPassUI.java

/**
* Auto-generated main method to display this JFrame
*///from w w w .  j  av  a  2 s. c  o  m
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            RetryByPassUI inst = new RetryByPassUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:ClassTree.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new ClassTreeFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);//ww w . java  2  s.  c  o  m
        }
    });
}