Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 12th, 2012  |  syntax: Java  |  size: 1.25 KB  |  views: 96  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package com.mediacitizens.jmcapp.desktop.windows.presentation;
  2.  
  3. import java.io.File;
  4. import java.io.PrintStream;
  5.  
  6. import javafx.application.Application;
  7. import javafx.scene.Scene;
  8. import javafx.scene.control.TextArea;
  9. import javafx.scene.control.TextAreaBuilder;
  10. import javafx.stage.DirectoryChooser;
  11. import javafx.stage.Stage;
  12.  
  13. public class Main extends Application
  14. {
  15.  
  16.         @Override
  17.         public void start(Stage primaryStage)
  18.         {
  19.  
  20.                 TextArea ta = TextAreaBuilder.create().prefWidth(800).prefHeight(600).wrapText(true).build();
  21.                 Console console = new Console(ta);
  22.                 PrintStream ps = new PrintStream(console, true);
  23.                 System.setOut(ps);
  24.                 System.setErr(ps);
  25.                 Scene app = new Scene(ta);
  26.  
  27.                 primaryStage.setScene(app);
  28.                 primaryStage.show();
  29.  
  30.                 // ask for installation folder
  31.                 DirectoryChooser installPathChooser = new DirectoryChooser();
  32.                 installPathChooser.setTitle("Select installation path");
  33.                 File installPath = installPathChooser.showDialog(primaryStage);
  34.                 if (installPath == null)
  35.                 {
  36.                         System.exit(0);
  37.                 }
  38.  
  39.                 CoreTest t = new CoreTest(installPath);
  40.  
  41.                 try
  42.                 {
  43.                         t.perform();
  44.                 }
  45.                 catch (Exception e)
  46.                 {
  47.                         e.printStackTrace();
  48.                 }
  49.  
  50.                 ps.close();
  51.         }
  52.  
  53.         public static void main(String[] args)
  54.         {
  55.                 launch(args);
  56.         }
  57.  
  58. }