当前位置: 首页>>代码示例>>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;未经允许,请勿转载。