當前位置: 首頁>>代碼示例>>Java>>正文


Java Application類代碼示例

本文整理匯總了Java中javafx.application.Application的典型用法代碼示例。如果您正苦於以下問題:Java Application類的具體用法?Java Application怎麽用?Java Application使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Application類屬於javafx.application包,在下文中一共展示了Application類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: bootstrap

import javafx.application.Application; //導入依賴的package包/類
public static synchronized void bootstrap() {
	if( launched ) {
		return;
	}
	launched = true;
	l = new CountDownLatch(1);
	Thread t = new Thread() {
		@Override
		public void run() {
			Application.launch(BootApplication.class);
		}
	};
	t.start();
	try {
		l.await();
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
開發者ID:BestSolution-at,項目名稱:FX-Test,代碼行數:21,代碼來源:ApplicationLaunch.java

示例2: plot

import javafx.application.Application; //導入依賴的package包/類
public static void plot(LineGraph... graphs) {
    if (plotted)
        throw new RuntimeException("Plot can be called only once. Instead put all graphs in one call.");
    plotted = true;

    Plotter.graphs = graphs;

    try {
        Application.launch();
    } catch (IllegalStateException e) {
        showGraphs();
    }
}
 
開發者ID:DrMerfy,項目名稱:GraphCreator,代碼行數:14,代碼來源:Plotter.java

示例3: setTheme

import javafx.application.Application; //導入依賴的package包/類
public void setTheme() {
    JSONObject themeSection = Preferences.instance().getSection("theme");
    boolean builtin = themeSection.optBoolean("builtin");
    String path = themeSection.optString("path", "/themes/marathon.css");
    String name = themeSection.optString("name", "Marathon");
    if (builtin) {
        if (name != null) {
            Application.setUserAgentStylesheet(name);
        }
    } else {
        if (path != null) {
            URL resource = getClass().getResource(path);
            if (resource != null) {
                Application.setUserAgentStylesheet(resource.toExternalForm());
            }
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:DisplayWindow.java

示例4: main

import javafx.application.Application; //導入依賴的package包/類
public static void main(String[] args) {
    if(args.length >= 1){
        try{
            StarsRiver.MainWindows.date = LocalDate.parse(args[0],DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        }
        catch(Exception e){
            StarsRiver.MainWindows.date = LocalDate.now();
        }
    }
    Application.launch(MainWindows.class, args);
}
 
開發者ID:starsriver,項目名稱:JavaHomework,代碼行數:12,代碼來源:MainWindows.java

示例5: startGUI

import javafx.application.Application; //導入依賴的package包/類
protected static void startGUI() {
    new Thread() {
        public void run() {
            Application.launch(GOGUIImpl.class);
        }
    }.start();
}
 
開發者ID:BlueWizardNedap,項目名稱:gogui,代碼行數:8,代碼來源:GOGUIImpl.java

示例6: main

import javafx.application.Application; //導入依賴的package包/類
public static void main(String[] args) throws IOException {
	try {
		Application.launch(args);
		System.exit(0);
	} catch (Exception e) {
		LOGGER.error("Uncaught exception", e);
		System.exit(1);
	}
}
 
開發者ID:Azzurite,項目名稱:MinecraftServerSync,代碼行數:10,代碼來源:MinecraftServerSync.java

示例7: startApplication

import javafx.application.Application; //導入依賴的package包/類
public static void startApplication() {
    new Thread(new Runnable() {
        @Override public void run() {
            Application.launch(ApplicationHelper.class);
        }
    }).start();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:8,代碼來源:JavaFXElementTest.java

示例8: start

import javafx.application.Application; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
	try {
		final SplashScreen splash = SplashScreen.getSplashScreen();

        // Determine if we passed anything on the cmd line
        parseCmdLine();

        // Define our controllers
        SpeedGuideViewController viewController = loadFXMLController("view/SpeedGuideView.fxml");
        SpeedGuideConnection connectionController = loadFXMLController("view/ConnectionDialog.fxml");

		// Wire up our Model/View/Controllers
		viewController.setConnectionViewController(connectionController);
		viewController.setDebug(m_debug);
		viewController.defineControlBindings(m_consumer);

		// Notify our consumer some setup information
        m_consumer.setDebug(m_debug);
        m_consumer.setViewController(viewController);

		// Define the main viewing scene,
        AnchorPane layout = viewController.getLayout();
		Scene scene = new Scene(layout, layout.getPrefWidth(), layout.getPrefHeight());

		// Prevent the user from resizing the window too small
		primaryStage.setMinHeight(layout.getMinHeight());
		primaryStage.setMinWidth(layout.getMinWidth());

		// Assign to our main stage and show the application to the end user
		primaryStage.setTitle("Speed Guide");
		primaryStage.setScene(scene);
		primaryStage.show();

		// Set up our EMA Consumer and launch a thread to run...
        Thread t = new Thread(m_consumer);
        t.start();

    	Application.Parameters params = getParameters();
    	connectionController.initialize(params.getNamed().get(HOST_PARAM),
    						  			params.getNamed().get(SERVICE_PARAM),
    						  			params.getNamed().get(USER_PARAM),
    						  			m_consumer);

        // Attempt to Connect into Elektron
		if ( splash != null )
			splash.close();
        connectionController.connect();
	} catch  (Exception e) {
		System.out.print("Exception in Application Start: ");
		e.printStackTrace();
		stop();
	}
}
 
開發者ID:TR-API-Samples,項目名稱:Example.EMA.Java.SpeedGuide,代碼行數:55,代碼來源:SpeedGuide.java

示例9: initJFX

import javafx.application.Application; //導入依賴的package包/類
@BeforeClass
public static void initJFX() {
	Thread t = new Thread("JavaFX Init Thread") {
		public void run() {
			Application.launch(FakeApp.class, new String[0]);
		}
	};
	t.setDaemon(true);
	t.start();
}
 
開發者ID:vibridi,項目名稱:qgu,代碼行數:11,代碼來源:MainTest.java

示例10: main

import javafx.application.Application; //導入依賴的package包/類
/**
 * @param args
 *            the Arguments used to start the JVM
 * @throws InterruptedException
 *             When something unexcpted happens
 */
public static void main(String[ ] args) throws InterruptedException
{
	Main.launchArgs = args.clone();
	PWLogger.setupLogger();
	PWLogger.getLogger("Main").info("Starting");
	PWLogger.getLogger("Main").info("Startup Arguments: " + Arrays.toString(Main.launchArgs));
	Application.launch(Overview.class, args);
	PWLogger.getLogger("Main").info("Exit");
}
 
開發者ID:Pingger,項目名稱:Pinggers-GIT-SVN-Client,代碼行數:16,代碼來源:Main.java

示例11: main

import javafx.application.Application; //導入依賴的package包/類
public static void main (String[] args) {
    //initialize language files
    LangInitializer.init("./data/i18n/languages.json");

    //create JavaFX window
    Application.launch(JavaFXApplication.class, args);
}
 
開發者ID:leeks-and-dragons,項目名稱:dialog-tool,代碼行數:8,代碼來源:Main.java

示例12: shouldRunBravo

import javafx.application.Application; //導入依賴的package包/類
@Test
public void shouldRunBravo() throws InterruptedException {
	Application.launch(BravoTestApp.class, null);
	finishedAnimation.await();

	assertTrue(duration > 13000);
	assertTrue(duration < 14000);
}
 
開發者ID:schwabdidier,項目名稱:GazePlay,代碼行數:9,代碼來源:BravoTestVisual.java

示例13: parseCmdLine

import javafx.application.Application; //導入依賴的package包/類
private void parseCmdLine() throws Exception
 {
 	Application.Parameters params = getParameters();
 	if ( params.getRaw().contains("--h") || params.getRaw().contains("--help") ||
 		 params.getNamed().containsKey("h") || params.getNamed().containsKey("help"))
 	{
 		System.out.println(NEWLINE+"Syntax:"+NEWLINE);
 		System.out.println("  > java -jar SpeedGuide.jar [options]  or"+NEWLINE);
 		System.out.println("  > SpeedGuide.exe [options] <Windows only>"+NEWLINE);
 		System.out.println("Options:"+NEWLINE);
 		System.out.println("  --host=hostname:port    Server address/hostname and port of your Market Data server.");
 		System.out.println("                          Syntax: <host/ip>:<port>.  Eg: elektron:14002 or 192.168.1.1:14002");
System.out.println("  --service=serviceName   Service Name providing market data content.");
System.out.println("                          Eg: ELEKTRON_AD.");
System.out.println("  --user=userName         User name required if authentication is enabled on server.");
System.out.println("                          Note: if no user name is provided, the utility will use your desktop login");
System.out.println("  --d[ebug]               Debug Mode.  Display verbose messages to the console");
System.out.println("  --h[elp]                Prints this screen"+NEWLINE);
System.out.println("If neither the --host nor --service is not provided, the utility will prompt the user to enter these values."+NEWLINE);
System.out.println("Example:");
System.out.println("  > SpeedGuide.exe --host=elektron:14002 --service=ELEKTRON_AD -user=testuser");
 		stop();
 	}

 	m_debug = params.getRaw().contains("--d") || params.getRaw().contains("--debug") ||
 			 params.getNamed().containsKey("d") || params.getNamed().containsKey("debug");
 }
 
開發者ID:TR-API-Samples,項目名稱:Example.EMA.Java.SpeedGuide,代碼行數:28,代碼來源:SpeedGuide.java

示例14: main

import javafx.application.Application; //導入依賴的package包/類
public static void main(String[] args) throws ReflectiveOperationException {

		loadPlugins();

		// IntelliJ is not able to comprehend this much Lambda? (as it was before)
		Registerer.registerObjects(Device.class, DeviceRegister.getInstance());
		Registerer.registerParsed(Effect.class, c -> EffectFactory.createFactory(c), EffectsRegister.getInstance());
		Registerer.registerParsed(ValueStrategy.class, c -> ValueStrategyFactory.createFactory(c), ValueStrategyRegister.getInstance());
		Registerer.registerParsed(BlendMode.class, c -> BlendModeFactory.createFactory(c), BlendModeRegister.getInstance());
		Registerer.registerParsed(ScaleMode.class, c -> ScaleModeFactory.createFactory(c), ScaleModeRegister.getInstance());

		Application.launch(KeyboardLightComposerApplication.class, args);

		// DefaultRenderer renderer = new DefaultRenderer();
		// Device device =
		// DeviceRegister.getInstance().getRegisteredObjectsAsList().get(0);
		//
		// renderer.setDevice(device);
		//
		// Effect effect =
		// EffectsRegister.getInstance().getRegisteredObjectsAsList().get(0).newInstance();
		// EffectLayer solidColorLayer = new EffectLayer(effect);
		//
		// solidColorLayer.getEffectLayerInformation().getWidth().setValue(5);
		// solidColorLayer.getEffectLayerInformation().getHeight().setValue(3);
		//
		// solidColorLayer.getEffectLayerInformation().getX().setValue(3);
		// solidColorLayer.getEffectLayerInformation().getY().setValue(3);
		//
		// device.init();
		//
		// renderer.render(Arrays.asList(solidColorLayer));
		//
		// sleep();
		//
		// device.shutdown();

	}
 
開發者ID:enoy19,項目名稱:keyboard-light-composer,代碼行數:39,代碼來源:KeyboardLightComposer.java

示例15: buildDockPane

import javafx.application.Application; //導入依賴的package包/類
private void buildDockPane() {
	dockPane = new DockPane();
	Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
	DockPane.initializeDefaultUserAgentStylesheet();
}
 
開發者ID:GoSuji,項目名稱:Suji,代碼行數:6,代碼來源:Main.java


注:本文中的javafx.application.Application類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。