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:PriorityCompete.java

public static void main(String[] args) {
    Runnable r = new Runnable() {
        public void run() {
            System.out.println("Run without using yield()");
            System.out.println("=========================");
            runSet(false);/*ww w. ja  v  a  2s .  c om*/

            System.out.println();
            System.out.println("Run using yield()");
            System.out.println("=================");
            runSet(true);
        }
    };

    Thread t = new Thread(r, "Priority");
    t.setPriority(Thread.MAX_PRIORITY - 1);
    t.start();
}

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

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

From source file:edu.cmu.cs.diamond.pathfind.main.PathFindDjango.java

public static void main(String[] args) {
    if (args.length != 4 && args.length != 5) {
        System.out.println("usage: " + PathFindDjango.class.getName()
                + " predicate_dir interface_map slide_map annotation_uri");
        return;/*from w  ww. j  ava  2 s .  c  o m*/
    }

    final String predicateDir = args[0];
    final String interfaceMap = args[1];
    final String slideMap = args[2];
    final String annotationUri = args[3];

    final File slide;
    if (args.length == 5) {
        slide = new File(args[4]);
    } else {
        slide = null;
    }

    final AnnotationStore annotationStore = new DjangoAnnotationStore(new HttpClient(), annotationUri);

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            try {
                new PathFindFrame(predicateDir, annotationStore, interfaceMap, slideMap, slide, false);
            } catch (IOException e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(null, e, "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
    });
}

From source file:events.MouseEventDemo.java

public static void main(String[] args) {
    /* Use an appropriate Look and Feel */
    try {/*w w  w .j a  v  a  2s  .  c  om*/
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {
        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use of bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);
    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });
}

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

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

From source file:events.MouseMotionEventDemo.java

public static void main(String[] args) {
    /* Use an appropriate Look and Feel */
    try {//w  ww .  j  ava2s .  c  o  m
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {

        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use of bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);

    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });
}

From source file:events.KeyEventDemo.java

public static void main(String[] args) {
    /* Use an appropriate Look and Feel */
    try {/* w w  w  . ja  v a2 s .co m*/
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {
        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use of bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);

    //Schedule a job for event dispatch thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });
}

From source file:events.MouseWheelEventDemo.java

public static void main(String[] args) {
    /* Use an appropriate Look and Feel */
    try {/*from   w  ww  .j  a va 2  s. co m*/
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (UnsupportedLookAndFeelException ex) {
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        ex.printStackTrace();
    } catch (InstantiationException ex) {
        ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
        ex.printStackTrace();
    }
    /* Turn off metal's use of bold fonts */
    UIManager.put("swing.boldMetal", Boolean.FALSE);

    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });
}

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

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

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

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