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:gtu.zcognos.DimensionUI.java

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

From source file:dbmods.InsertTemplateName.java

/**
* Auto-generated main method to display this JFrame
*///from   www .ja v a 2s  .  c  om
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            InsertTemplateName inst = new InsertTemplateName();
            inst.setLocationRelativeTo(null);
            inst.setTitle("Insert Into parse_template");
            Image icon = Toolkit.getDefaultToolkit().getImage("gf.png");
            inst.setIconImage(icon);
            inst.setVisible(true);
        }
    });
}

From source file:StoppUhr.java

/**
* Auto-generated main method to display this JFrame
*/// w w w .  ja va2 s.co  m
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            StoppUhr inst = new StoppUhr();
            inst.setLocationRelativeTo(null);
            inst.setVisible(true);
        }
    });
}

From source file:com.SCI.centraltoko.Main.java

@SuppressWarnings("Convert2Lambda")
public static void main(String[] args) {
    // TODO code application logic here
    //        Memasang LookAndFeel
    try {/*from  www .  j a  v  a 2s.  co  m*/
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                javax.swing.UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (ClassNotFoundException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }

    //        Membuat tread
    try {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {

                ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                        "SpringXMLConfig.xml");
                masterService = (MasterService) applicationContext.getBean("masterService");
                transaksiService = (TransaksiSevice) applicationContext.getBean("transaksiSevice");
                laporan = (Laporan) applicationContext.getBean("laporan");

                mainFrame = new MainFrame();

                mainFrame.setVisible(true);

            }
        });
    } catch (Exception ex) {
        java.util.logging.Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }

}

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

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

From source file:net.jingx.main.Main.java

/**
 * @param args// w  w  w.  ja  v a 2s.c  o m
 * @throws IOException 
 */
public static void main(String[] args) {
    CommandLineParser parser = new PosixParser();
    Options options = new Options();
    options.addOption(CLI_SECRET, true, "generate secret key (input is the configuration key from google)");
    options.addOption(CLI_PASSCODE, true, "generate passcode (input is the secret key)");
    options.addOption(new Option(CLI_HELP, "print this message"));
    try {
        CommandLine line = parser.parse(options, args);
        if (line.hasOption(CLI_SECRET)) {
            String confKey = line.getOptionValue(CLI_SECRET);
            String secret = generateSecret(confKey);
            System.out.println("Your secret to generate pins: " + secret);
        } else if (line.hasOption(CLI_PASSCODE)) {
            String secret = line.getOptionValue(CLI_PASSCODE);
            String pin = computePin(secret, null);
            System.out.println(pin);
        } else if (line.hasOption(CLI_HELP)) {
            HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp("GAuthCli", options);
        } else {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    try {
                        MainGui window = new MainGui();
                        window.doSetVisible();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
            return;
        }
        System.out.println("Press any key to exit");
        System.in.read();
    } catch (Exception e) {
        System.out.println("Unexpected exception:" + e.getMessage());
    }
    System.exit(0);
}

From source file:Test.java

public static void main(String[] args) throws Exception {
    Thread serverThread = new Thread(new Runnable() {
        @Override/*from   w w  w  .  j a va 2s.  c  om*/
        public void run() {
            serverStart();
        }
    });
    serverThread.start();
    Thread clientThread = new Thread(new Runnable() {
        @Override
        public void run() {
            clientStart();
        }
    });
    clientThread.start();
}

From source file:com.github.lburgazzoli.sandbox.reactor.ProcessorMain.java

public static void main(String[] args) {
    try {//w w  w  .j  a va 2s.c o  m
        final Processor<Message> processor = new ProcessorSpec<Message>().dataSupplier(new MessageSupplier())
                .consume(new ThrottlingMessageConsumer(10)).singleThreadedProducer().dataBufferSize(1024).get();

        Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS);

        Thread th = new Thread(new Runnable() {
            public void run() {
                for (int i = 0; i < 20; i++) {
                    Operation<Message> op = processor.get();
                    op.get().type = i;
                    op.commit();
                }
            }
        });

        th.start();
        th.join();

        processor.shutdown();

        Uninterruptibles.sleepUninterruptibly(10, TimeUnit.SECONDS);

    } catch (Exception e) {
        LOGGER.warn("Main Exception", e);
    }
}

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

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

From source file:de.codesourcery.eve.skills.ui.spreadsheet.SpreadSheetTableModel.java

public static void main(String[] args) {

    final ITableFactory cellFactory = new ITableFactory() {

        @Override/*from   w ww.  j av  a2 s .c  o  m*/
        public ITableCell createEmptyCell(int row, int column) {
            return new SimpleCell();
        }

        @Override
        public TableRow createRow(SpreadSheetTableModel tableModel) {
            return new TableRow(tableModel);
        }

    };

    final SpreadSheetTableModel model = new SpreadSheetTableModel(cellFactory);

    final JTable table = new JTable(model);

    table.setFillsViewportHeight(true);

    final JFrame frame = new JFrame("Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //      table.setPreferredSize( new Dimension(400,200 ) );
    table.setBorder(BorderFactory.createLineBorder(Color.black));

    frame.getContentPane().add(new JScrollPane(table));

    SwingUtilities.invokeLater(new Runnable() {

        @Override
        public void run() {
            frame.pack();
            frame.setLocationRelativeTo(null);

            frame.setVisible(true);

            model.addRow(new SimpleCell("First row") {
                public boolean isEditable() {
                    return true;
                }

                public void setValue(Object value) {
                    System.out.println("new value: " + value);
                }
            });
            model.addRow(new SimpleCell("Second row #1"), new SimpleCell("Second row #2"));
            model.addRow(new SimpleCell("Third row #1"), new SimpleCell("Third row #2"),
                    new SimpleCell("Third row #3"));

            JTextField tf = new JTextField();

            table.setModel(model);
            table.setDefaultEditor(ITableCell.class, new DefaultCellEditor(tf));
        }
    });

}